List of utility methods to do UTF16 Convert
String | toUTF16LEString(String input) Convert the input string to String encoded in UTF16LE format. if (input == null || input.length() == 0) { return input; byte[] b = input.getBytes("UTF-16LE"); return hexToString(b); |
int | UTF16toUTF8(CharSequence s, int offset, int len, byte[] result, int resultOffset) Writes UTF8 into the byte array, starting at offset. final int end = offset + len; int upto = resultOffset; for (int i = offset; i < end; i++) { final int code = (int) s.charAt(i); if (code < 0x80) result[upto++] = (byte) code; else if (code < 0x800) { result[upto++] = (byte) (0xC0 | (code >> 6)); ... |