Lua:wideStringToByteTable
Jump to navigation
Jump to search
function wideStringToByteTable(String) : Table
Converts a string to a wide string (UTF-16/Unicode) and then to a table of bytes.
Function Parameters
| Parameter | Type | Description |
|---|---|---|
| String | String | The string to convert to a wide string and then to a byte table. |
Returns
Table — A table containing the bytes representing the wide string (UTF-16/Unicode).
Examples
local bytes = wideStringToByteTable("ABC")
for i, b in ipairs(bytes) do
print(string.format("Byte %d: %02X", i, b))
end
-- Output: 6 bytes representing "A", "B", "C" as UTF-16LE (e.g., 41 00 42 00 43 00)
See also
| Lua |
| Script Engine |
Related Functions
| Read Functions |
|---|
| readBytes |
| readSmallInteger |
| readInteger |
| readQword |
| readPointer |
| readFloat |
| readDouble |
| readString |
| Read Functions (Local Process) |
| readBytesLocal |
| readIntegerLocal |
| readQwordLocal |
| readPointerLocal |
| readFloatLocal |
| readDoubleLocal |
| readStringLocal |
| Write Functions |
| writeBytes |
| writeSmallInteger |
| writeInteger |
| writeQword |
| writeFloat |
| writeDouble |
| writeString |
| Write Functions (Local Process) |
| writeBytesLocal |
| writeIntegerLocal |
| writeQwordLocal |
| writeFloatLocal |
| writeDoubleLocal |
| writeStringLocal |
| Byte Table Conversions (Value → Byte Table) |
| wordToByteTable |
| dwordToByteTable |
| qwordToByteTable |
| floatToByteTable |
| doubleToByteTable |
| stringToByteTable |
| wideStringToByteTable |
| Byte Table Conversions (Byte Table → Value) |
| byteTableToWord |
| byteTableToDword |
| byteTableToQword |
| byteTableToFloat |
| byteTableToDouble |
| byteTableToString |
| byteTableToWideString |