Java Utililty Methods UTF16 Convert

List of utility methods to do UTF16 Convert

  1. HOME
  2. Java
  3. U
  4. UTF16 Convert

Description

The list of methods to do UTF16 Convert are organized into topic(s).

Method

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));
...

AltStyle によって変換されたページ (->オリジナル) /