Decoding of UTF-8 is based on a presentation by Bob Steagall at CppCon2018 (see https://github.com/BobSteagall/CppCon2018). It uses a Deterministic Finite Automaton (DFA) to recognize and decode multi-byte code points.
| Modifier and Type | Field and Description |
|---|---|
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final short[] | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| private static final byte[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| public static int | Returns: The number of UTF-16 code units written toutf16 (beginning from index 0), or
else -1 if the input was either malformed or encoded any unmappable characters, or if
the utf16 is too small.A non-null array containing a well-formed UTF-8 encoding. utf8, char[] A non-null array, at least as long as the utf16)utf8 array in order to ensure
the output will fit.Transcode a UTF-8 encoding into a UTF-16 representation. |
| public static int | Returns: The number of UTF-16 code units written toutf16 (beginning from index 0), or
else -1 if the input was either malformed or encoded any unmappable characters, or if
the utf16 is too small.A non-null array containing a well-formed UTF-8 encoding. utf8, int start position in the array for the well-formed encoding. utf8Off, int length in bytes of the well-formed encoding. utf8Length, char[] A non-null array, at least as long as the utf16)utf8 array in order to ensure
the output will fit.Transcode a UTF-8 encoding into a UTF-16 representation. |
| C_CR1 | back to summary |
|---|---|
| private static final byte C_CR1 | |
| C_CR2 | back to summary |
|---|---|
| private static final byte C_CR2 | |
| C_CR3 | back to summary |
|---|---|
| private static final byte C_CR3 | |
| C_ILL | back to summary |
|---|---|
| private static final byte C_ILL | |
| C_L2A | back to summary |
|---|---|
| private static final byte C_L2A | |
| C_L3A | back to summary |
|---|---|
| private static final byte C_L3A | |
| C_L3B | back to summary |
|---|---|
| private static final byte C_L3B | |
| C_L3C | back to summary |
|---|---|
| private static final byte C_L3C | |
| C_L4A | back to summary |
|---|---|
| private static final byte C_L4A | |
| C_L4B | back to summary |
|---|---|
| private static final byte C_L4B | |
| C_L4C | back to summary |
|---|---|
| private static final byte C_L4C | |
| firstUnitTable | back to summary |
|---|---|
| private static final short[] firstUnitTable | |
| S_CS1 | back to summary |
|---|---|
| private static final byte S_CS1 | |
| S_CS2 | back to summary |
|---|---|
| private static final byte S_CS2 | |
| S_CS3 | back to summary |
|---|---|
| private static final byte S_CS3 | |
| S_END | back to summary |
|---|---|
| private static final byte S_END | |
| S_ERR | back to summary |
|---|---|
| private static final byte S_ERR | |
| S_P3A | back to summary |
|---|---|
| private static final byte S_P3A | |
| S_P3B | back to summary |
|---|---|
| private static final byte S_P3B | |
| S_P4A | back to summary |
|---|---|
| private static final byte S_P4A | |
| S_P4B | back to summary |
|---|---|
| private static final byte S_P4B | |
| transitionTable | back to summary |
|---|---|
| private static final byte[] transitionTable | |
| UTF8 | back to summary |
|---|---|
| public UTF8() | |
| fill | back to summary |
|---|---|
| private static void fill(byte[] table, int first, int last, byte b) | |
| transcodeToUTF16 | back to summary |
|---|---|
| public static int transcodeToUTF16(byte[] utf8, char[] utf16) Transcode a UTF-8 encoding into a UTF-16 representation. In the general case the output
| |
| transcodeToUTF16 | back to summary |
|---|---|
| public static int transcodeToUTF16(byte[] utf8, int utf8Off, int utf8Length, char[] utf16) Transcode a UTF-8 encoding into a UTF-16 representation. In the general case the output
| |