* Map a character code to Unicode with explicit length. * @param code Character code value * @param length Original byte length of the code * @returns Unicode string, or undefined if not mapped
(code: number, length: number)
| 114 | * @returns Unicode string, or undefined if not mapped |
| 115 | */ |
| 116 | toUnicodeWithLength(code: number, length: number): string | undefined { |
| 117 | switch (length) { |
| 118 | case 1: |
| 119 | return this.charToUnicodeOneByte.get(code); |
| 120 | case 2: |
| 121 | return this.charToUnicodeTwoBytes.get(code); |
| 122 | default: |
| 123 | return this.charToUnicodeMoreBytes.get(code); |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Map character code bytes to Unicode. |
no test coverage detected