T480
Extended Printer Control
T480
Programmer’s Guide
Page
218
Rev A
100-14362
UTF-16
UTF-16 is the most straightforward way to access characters above 255. UTF-16
essentially sends two 8-bit bytes that form a 16-bit address to access the desired
character. Basic UTF-16 does not define the byte order. If you wish to use UTF-16 and
allow the printer to determine the byte order, you must send the byte order mark
(0xFEFF) before you send any characters. To prevent loss of byte order
synchronization, you should periodically send the byte order mark to resynchronize the
printer with your application. If UTF-16 is selected, all data sent to the printer must be
16 bits. All commands and command parameters are also 16 bit, however only values
between 0 and 255 are valid. Extended addressing uses surrogate pairs to encode
values above 0xFFFF.
Scalar Value
UTF-16
xxxxxxxxxxxxxxxx
xxxxxxxx xxxxxxxx
000uuuuuxxxxxxxxxxxxxxxx 110110wwwwxxxxxx
110111xxxxxxxxxx
Note: wwww = uuuuu
– 1 and uuuuu may not be larger than 10000
Unicode Extended UTF16 Encoding Example
3 Byte output Example
Hex Character Code: 0x00010302
00 01 03 02
- Original Hex Code(s)
00000000 000
00001
000000
11 00000010
- Converted to Binary
00000000 000
00001
000000
11 00000010
- Bit Sections
Discarded
0000
000000
11 00000010
- Adjusted by subtracting
1 from uuuuu
0000
000000
1100000010
- Merged into two
10 bit values
110110
0000
000000
110111
1100000010
- Surrogates added
1101 10
00 00
00 0000
1101 11
11 0000 0010
- 2 16 bit values
0xD800 0xDF02
- 2 16 bit hex values
UTF-16
With UTF16 values from 0x0000000000 to 0x0000D7FF and 0x0000E000 to
0x0010FFFF may be represented Values from 0x0000D800 to 0x0000DFFF and above
0x0010FFFF are not valid and in fact are not valid for any characters in Unicode rev 5.0
regardless of encoding.
UTF-16BE uses the big-endian method of sending the two bytes. This method sends the
high byte first and then the low byte. It is not required to send the byte order mark