JDK Tutorials - Herong's Tutorial Examples - v6.32, by Herong Yang
Character Set Encoding Maps - Unicode UTF-16, UTF-16LE, UTF-16BE
This section provides a tutorial example of analyzing and printing character set encoding maps for 3 encoding, UTF-16, UTF-16LE, and UTF-16BE, for Unicode character set.
Here is the output of my sample program, EncodingAnalyzer.java, for UTF-16 encoding:
herong> java EncodingAnalyzer.java UTF-16 Code Point > Byte Sequence - Code Point > Byte Sequence 0000 > FE FF 00 00 - 00FF > FE FF 00 FF 0100 > FE FF 01 00 - 01FF > FE FF 01 FF 0200 > FE FF 02 00 - 02FF > FE FF 02 FF ...... D700 > FE FF D7 00 - D7FF > FE FF D7 FF D800 > FE FF FF FD - DFFF > FE FF FF FD E000 > FE FF E0 00 - E0FF > FE FF E0 FF E100 > FE FF E1 00 - E1FF > FE FF E1 FF E200 > FE FF E2 00 - E2FF > FE FF E2 FF ...... FF00 > FE FF FF 00 - FFFF > FE FF FF FF
The encoding map of UTF-16, which is another encoding used for the Unicode character set, is much simpler than UTF-8:
Here is the output for UTF-16LE encoding, the little-endian variation of UTF-16 encoding:
herong> java EncodingAnalyzer.java UTF-16LE Code Point > Byte Sequence - Code Point > Byte Sequence 0000 > 00 00 - D7FF > FF D7 D800 > FD FF - DFFF > FD FF E000 > 00 E0 - FFFF > FF FF
The encoding map of UTF-16LE is so simple:
Here is the output for UTF-16BE encoding, the big-endian variation of UTF-16 encoding:
herong> java EncodingAnalyzer.java UTF-16BE Code Point > Byte Sequence - Code Point > Byte Sequence 0000 > 00 00 - 00FF > 00 FF 0100 > 01 00 - 01FF > 01 FF 0200 > 02 00 - 02FF > 02 FF ...... D700 > D7 00 - D7FF > D7 FF D800 > FF FD - DFFF > FF FD E000 > E0 00 - E0FF > E0 FF E100 > E1 00 - E1FF > E1 FF E200 > E2 00 - E2FF > E2 FF ...... FF00 > FF 00 - FFFF > FF FF
The encoding map of UTF-16BE is also simple:
Table of Contents
Date, Time and Calendar Classes
Date and Time Object and String Conversion
Number Object and Numeric String Conversion
Locales, Localization Methods and Resource Bundles
Calling and Importing Classes Defined in Unnamed Packages
HashSet, Vector, HashMap and Collection Classes
Character Set Encoding Classes and Methods
Character Set Encoding Map Analyzer
Character Set Encoding Maps - US-ASCII and ISO-8859-1/Latin 1
Character Set Encoding Maps - CP1252/Windows-1252
Character Set Encoding Maps - Unicode UTF-8
►Character Set Encoding Maps - Unicode UTF-16, UTF-16LE, UTF-16BE
Character Counter Program for Any Given Encoding
Character Set Encoding Comparison
Encoding Conversion Programs for Encoded Text Files
Datagram Network Communication
DOM (Document Object Model) - API for XML Files
DTD (Document Type Definition) - XML Validation
XSD (XML Schema Definition) - XML Validation
XSL (Extensible Stylesheet Language)
Message Digest Algorithm Implementations in JDK
Private key and Public Key Pair Generation
PKCS#8/X.509 Private/Public Encoding Standards
Digital Signature Algorithm and Sample Program
"keytool" Commands and "keystore" Files
KeyStore and Certificate Classes
Secret Key Generation and Management
Cipher - Encryption and Decryption
The SSL (Secure Socket Layer) Protocol
SSL Socket Communication Testing Programs