(code: number, encoding: Charset = null)
| 44 | // EUC_JP.equalsIgnoreCase(PLATFORM_DEFAULT_ENCODING); |
| 45 | |
| 46 | static castAsNonUtf8Char(code: number, encoding: Charset = null) { |
| 47 | // ISO 8859-1 is the Java default as UTF-8 is JavaScripts |
| 48 | // you can see this method as a Java version of String.fromCharCode |
| 49 | const e = encoding ? encoding.getName() : this.ISO88591; |
| 50 | // use passed format (fromCharCode will return UTF8 encoding) |
| 51 | return StringEncoding.decode(new Uint8Array([code]), e); |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * @param bytes bytes encoding a string, whose encoding should be guessed |
no test coverage detected