Lines Matching refs:ucs2
93 static FLaC__INLINE size_t local__utf8_to_ucs2(const FLAC__byte *utf8, FLAC__uint16 *ucs2)
97 FLAC__ASSERT(0 != ucs2);
100 *ucs2 = *utf8;
102 *ucs2 = (*utf8 & 0x3F)<<6 | (*(utf8+1) & 0x3F);
104 *ucs2 = (*utf8 & 0x1F)<<12 | (*(utf8+1) & 0x3F)<<6 | (*(utf8+2) & 0x3F);
106 *ucs2 = '?';
148 static FLaC__INLINE size_t local__ucs2len(FLAC__uint16 ucs2)
150 if (ucs2 < 0x0080)
152 else if (ucs2 < 0x0800)
158 static FLaC__INLINE size_t local__ucs2_to_utf8(FLAC__uint16 ucs2, FLAC__byte *utf8)
160 if (ucs2 < 0x080) {
161 utf8[0] = (FLAC__byte)ucs2;
164 else if (ucs2 < 0x800) {
165 utf8[0] = 0xc0 | (ucs2 >> 6);
166 utf8[1] = 0x80 | (ucs2 & 0x3f);
170 utf8[0] = 0xe0 | (ucs2 >> 12);
171 utf8[1] = 0x80 | ((ucs2 >> 6) & 0x3f);
172 utf8[2] = 0x80 | (ucs2 & 0x3f);