12 int high = bigendian ? 0 : 1;
13 int low = bigendian ? 1 : 0;
14 if (ptrlen > 3 && (ptr[high] & 0xdc) == 0xd8 && (ptr[high + 2] & 0xdc) == 0xdc) {
16 *ch = ((ptr[high] & 3) << 24 | ptr[low] << 16 | (ptr[high + 2] & 3) << 8 | ptr[low + 2]) + 0x10000;
20 if (ptrlen > 1 && ptr[high]) {
22 *ch = ptr[high] << 8 | ptr[low];
49 ptr[1] = ch >> 8 & 0xff;
54 RzRune high = 0xd800 + (ch >> 10 & 0x3ff);
55 RzRune low = 0xdc00 + (ch & 0x3ff);
57 ptr[1] = high >> 8 & 0xff;
59 ptr[3] = low >> 8 & 0xff;
RZ_API int rz_utf16_decode(const ut8 *ptr, int ptrlen, RzRune *ch, bool bigendian)
RZ_API int rz_utf16le_encode(ut8 *ptr, RzRune ch)
RZ_API int rz_utf16le_decode(const ut8 *ptr, int ptrlen, RzRune *ch)
RZ_API int rz_utf16be_decode(const ut8 *ptr, int ptrlen, RzRune *ch)