Lines Matching refs:utf16
349 static int json_utf8_to_utf16(unsigned short *utf16, char utf8[], int len) /* {{{ */ in json_utf8_to_utf16() argument
354 if (utf16) { in json_utf8_to_utf16()
364 utf16[j++] = (unsigned short)((us >> 10) | 0xd800); in json_utf8_to_utf16()
365 utf16[j] = (unsigned short)((us & 0x3ff) | 0xdc00); in json_utf8_to_utf16()
367 utf16[j] = (unsigned short)us; in json_utf8_to_utf16()
391 unsigned short *utf16; in json_escape_string() local
423 …utf16 = (options & PHP_JSON_UNESCAPED_UNICODE) ? NULL : (unsigned short *) safe_emalloc(len, sizeo… in json_escape_string()
424 ulen = json_utf8_to_utf16(utf16, s, len); in json_escape_string()
426 if (utf16) { in json_escape_string()
427 efree(utf16); in json_escape_string()
450 us = (options & PHP_JSON_UNESCAPED_UNICODE) ? s[pos++] : utf16[pos++]; in json_escape_string()
541 if (utf16) { in json_escape_string()
542 efree(utf16); in json_escape_string()
659 unsigned short *utf16; in php_json_decode_ex() local
662 utf16 = (unsigned short *) safe_emalloc((str_len+1), sizeof(unsigned short), 1); in php_json_decode_ex()
664 utf16_len = json_utf8_to_utf16(utf16, str, str_len); in php_json_decode_ex()
666 if (utf16) { in php_json_decode_ex()
667 efree(utf16); in php_json_decode_ex()
675 efree(utf16); in php_json_decode_ex()
681 if (parse_JSON_ex(jp, z, utf16, utf16_len, options TSRMLS_CC)) { in php_json_decode_ex()
757 efree(utf16); in php_json_decode_ex()