Lines Matching refs:utf8p
260 utf8_encodestr(const u_int16_t * ucsp, size_t ucslen, u_int8_t * utf8p,
276 bufstart = utf8p;
310 if (utf8p >= bufend) {
314 *utf8p++ = ucs_ch;
317 if ((utf8p + 1) >= bufend) {
321 *utf8p++ = 0xc0 | (ucs_ch >> 6);
322 *utf8p++ = 0x80 | (0x3f & ucs_ch);
341 if ((utf8p + 3) >= bufend) {
347 *utf8p++ = 0xf0 | (pair >> 18);
348 *utf8p++ = 0x80 | (0x3f & (pair >> 12));
349 *utf8p++ = 0x80 | (0x3f & (pair >> 6));
350 *utf8p++ = 0x80 | (0x3f & pair);
356 if (utf8p >= bufend) {
360 *utf8p++ = ucs_ch;
364 if ((utf8p + 2) >= bufend) {
368 *utf8p++ = 0xe0 | (ucs_ch >> 12);
369 *utf8p++ = 0x80 | (0x3f & (ucs_ch >> 6));
370 *utf8p++ = 0x80 | (0x3f & ucs_ch);
374 *utf8len = utf8p - bufstart;
376 *utf8p++ = '\0';
411 utf8_decodestr(const u_int8_t* utf8p, size_t utf8len, u_int16_t* ucsp,
433 while (utf8len-- > 0 && (byte = *utf8p++) != '\0') {
452 byte = *utf8p++; /* 2nd byte */
463 byte = *utf8p++; /* 2nd byte */
467 byte = *utf8p++; /* 3rd byte */
484 byte = *utf8p++; /* 2nd byte */
488 byte = *utf8p++; /* 3rd byte */
492 byte = *utf8p++; /* 4th byte */
575 utf8p -= 3;
578 utf8p -= 2;
581 utf8p -= 1;
589 byte = *(utf8p - 1);
628 utf8_validatestr(const u_int8_t* utf8p, size_t utf8len)
635 while (utf8len-- > 0 && (byte = *utf8p++) != '\0') {
648 byte = *utf8p++; /* 2nd byte */
658 byte = *utf8p++; /* 2nd byte */
662 byte = *utf8p++; /* 3rd byte */
678 byte = *utf8p++; /* 2nd byte */
682 byte = *utf8p++; /* 3rd byte */
686 byte = *utf8p++; /* 4th byte */