• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/minidlna/libid3tag-0.15.0b/

Lines Matching refs:ucs4

32 # include "ucs4.h"
36 * DESCRIPTION: return the number of ucs4 chars represented by a utf8 string
117 * DESCRIPTION: duplicate and decode a utf8 string into ucs4
121 id3_ucs4_t *ucs4;
123 ucs4 = malloc((id3_utf8_length(utf8) + 1) * sizeof(*ucs4));
124 if (ucs4)
125 id3_utf8_decode(utf8, ucs4);
127 return release(ucs4);
132 * DESCRIPTION: decode a series of utf8 chars into a single ucs4 char
134 id3_length_t id3_utf8_decodechar(id3_utf8_t const *utf8, id3_ucs4_t *ucs4)
140 *ucs4 = utf8[0];
145 *ucs4 =
148 if (*ucs4 >= 0x00000080L)
154 *ucs4 =
158 if (*ucs4 >= 0x00000800L)
165 *ucs4 =
170 if (*ucs4 >= 0x00010000L)
178 *ucs4 =
184 if (*ucs4 >= 0x00200000L)
193 *ucs4 =
200 if (*ucs4 >= 0x04000000L)
210 * DESCRIPTION: encode a single ucs4 char into a series of up to 6 utf8 chars
212 id3_length_t id3_utf8_encodechar(id3_utf8_t *utf8, id3_ucs4_t ucs4)
214 if (ucs4 <= 0x0000007fL) {
215 utf8[0] = ucs4;
219 else if (ucs4 <= 0x000007ffL) {
220 utf8[0] = 0xc0 | ((ucs4 >> 6) & 0x1f);
221 utf8[1] = 0x80 | ((ucs4 >> 0) & 0x3f);
225 else if (ucs4 <= 0x0000ffffL) {
226 utf8[0] = 0xe0 | ((ucs4 >> 12) & 0x0f);
227 utf8[1] = 0x80 | ((ucs4 >> 6) & 0x3f);
228 utf8[2] = 0x80 | ((ucs4 >> 0) & 0x3f);
232 else if (ucs4 <= 0x001fffffL) {
233 utf8[0] = 0xf0 | ((ucs4 >> 18) & 0x07);
234 utf8[1] = 0x80 | ((ucs4 >> 12) & 0x3f);
235 utf8[2] = 0x80 | ((ucs4 >> 6) & 0x3f);
236 utf8[3] = 0x80 | ((ucs4 >> 0) & 0x3f);
240 else if (ucs4 <= 0x03ffffffL) {
241 utf8[0] = 0xf8 | ((ucs4 >> 24) & 0x03);
242 utf8[1] = 0x80 | ((ucs4 >> 18) & 0x3f);
243 utf8[2] = 0x80 | ((ucs4 >> 12) & 0x3f);
244 utf8[3] = 0x80 | ((ucs4 >> 6) & 0x3f);
245 utf8[4] = 0x80 | ((ucs4 >> 0) & 0x3f);
249 else if (ucs4 <= 0x7fffffffL) {
250 utf8[0] = 0xfc | ((ucs4 >> 30) & 0x01);
251 utf8[1] = 0x80 | ((ucs4 >> 24) & 0x3f);
252 utf8[2] = 0x80 | ((ucs4 >> 18) & 0x3f);
253 utf8[3] = 0x80 | ((ucs4 >> 12) & 0x3f);
254 utf8[4] = 0x80 | ((ucs4 >> 6) & 0x3f);
255 utf8[5] = 0x80 | ((ucs4 >> 0) & 0x3f);
267 * DESCRIPTION: decode a complete utf8 string into a ucs4 string
269 void id3_utf8_decode(id3_utf8_t const *utf8, id3_ucs4_t *ucs4)
272 utf8 += id3_utf8_decodechar(utf8, ucs4);
273 while (*ucs4++);
278 * DESCRIPTION: encode a complete ucs4 string into a utf8 string
280 void id3_utf8_encode(id3_utf8_t *utf8, id3_ucs4_t const *ucs4)
283 utf8 += id3_utf8_encodechar(utf8, *ucs4);
284 while (*ucs4++);
310 * DESCRIPTION: serialize a ucs4 string using utf8 encoding
312 id3_length_t id3_utf8_serialize(id3_byte_t **ptr, id3_ucs4_t const *ucs4,
318 while (*ucs4) {
319 switch (id3_utf8_encodechar(out = utf8, *ucs4++)) {
338 * DESCRIPTION: deserialize a ucs4 string using utf8 encoding
344 id3_ucs4_t *ucs4;
358 ucs4 = malloc((id3_utf8_length(utf8) + 1) * sizeof(*ucs4));
359 if (ucs4)
360 id3_utf8_decode(utf8, ucs4);
364 return ucs4;