Lines Matching +full:fail +full:- +full:fast
10 non-ASCII, UTF8-encoded char. */
36 /* Fast path for runs of ASCII characters. Given that common UTF-8 in STRINGLIB()
49 and do a fast unrolled copy if it only contains ASCII in STRINGLIB()
99 /* \xC2\x80-\xDF\xBF -- 0080-07FF */ in STRINGLIB()
103 \x80-\xBF -- continuation byte in STRINGLIB()
104 \xC0-\xC1 -- fake 0000-007F */ in STRINGLIB()
107 if (end - s < 2) { in STRINGLIB()
116 ch = (ch << 6) + ch2 - in STRINGLIB()
122 /* Out-of-range */ in STRINGLIB()
129 /* \xE0\xA0\x80-\xEF\xBF\xBF -- 0800-FFFF */ in STRINGLIB()
131 if (end - s < 3) { in STRINGLIB()
134 if (end - s < 2) in STRINGLIB()
152 \xE0\x80\x80-\xE0\x9F\xBF -- fake 0000-0800 */ in STRINGLIB()
155 /* Decoding UTF-8 sequences in range \xED\xA0\x80-\xED\xBF\xBF in STRINGLIB()
156 will result in surrogates in range D800-DFFF. Surrogates are in STRINGLIB()
157 not valid UTF-8 so they are rejected. in STRINGLIB()
159 (table 3-7) and http://www.rfc-editor.org/rfc/rfc3629.txt */ in STRINGLIB()
166 ch = (ch << 12) + (ch2 << 6) + ch3 - in STRINGLIB()
172 /* Out-of-range */ in STRINGLIB()
179 /* \xF0\x90\x80\x80-\xF4\x8F\xBF\xBF -- 10000-10FFFF */ in STRINGLIB()
181 if (end - s < 4) { in STRINGLIB()
184 if (end - s < 2) in STRINGLIB()
191 if (end - s < 3) in STRINGLIB()
208 \xF0\x80\x80\x80-\xF0\x8F\xBF\xBF -- fake 0000-FFFF */ in STRINGLIB()
212 \xF4\x90\x80\x80- -- 110000- overflow */ in STRINGLIB()
223 ch = (ch << 18) + (ch2 << 12) + (ch3 << 6) + ch4 - in STRINGLIB()
229 /* Out-of-range */ in STRINGLIB()
239 *outpos = p - dest; in STRINGLIB()
258 /* UTF-8 encoder specialized for a Unicode kind to avoid the slow
260 UCS-1 strings don't need to handle surrogates for example. */
309 /* Encode Latin-1 */ in STRINGLIB()
321 startpos = i-1; in STRINGLIB()
328 writer->overallocate = (endpos < size); in STRINGLIB()
333 memset(p, '?', endpos - startpos); in STRINGLIB()
334 p += (endpos - startpos); in STRINGLIB()
337 i += (endpos - startpos - 1); in STRINGLIB()
347 i += (endpos - startpos - 1); in STRINGLIB()
352 writer->min_size -= max_char_size * (endpos - startpos); in STRINGLIB()
357 i += (endpos - startpos - 1); in STRINGLIB()
362 writer->min_size -= max_char_size * (endpos - startpos); in STRINGLIB()
367 i += (endpos - startpos - 1); in STRINGLIB()
378 i += (endpos - startpos - 1); in STRINGLIB()
386 errors, &error_handler_obj, "utf-8", "surrogates not allowed", in STRINGLIB()
392 writer->min_size -= max_char_size * (newpos - startpos); in STRINGLIB()
405 raise_encode_exception(&exc, "utf-8", unicode, in STRINGLIB()
425 assert(writer->overallocate || i == size); in STRINGLIB()
465 /* The pattern for constructing UCS2-repeated masks. */
474 /* The mask for fast checking. */
476 /* The mask for fast checking of whether a C 'long' contains a
477 non-ASCII or non-Latin1 UTF16-encoded characters. */
480 /* The mask for fast checking of whether a C 'long' may contain
481 UTF16-encoded surrogate characters. This is an efficient heuristic,
482 assuming that non-surrogate characters with a code point >= 0x8000 are
487 /* The mask for fast byte-swapping. */
509 --e; in STRINGLIB()
516 /* Fast path for runs of in-range non-surrogate chars. */ in STRINGLIB()
526 /* Need to byte-swap */ in STRINGLIB()
569 /* Out-of-range */ in STRINGLIB()
576 /* UTF-16 code pair: */ in STRINGLIB()
587 /* Out-of-range */ in STRINGLIB()
596 *outpos = p - dest; in STRINGLIB()
678 /* reject surrogate characters (U+D800-U+DFFF) */ in STRINGLIB()
679 goto fail; in STRINGLIB()
713 /* reject surrogate characters (U+D800-U+DFFF) */ in STRINGLIB()
714 goto fail; in STRINGLIB()
731 fail: in STRINGLIB()
733 return len - (end - in + 1); in STRINGLIB()
782 /* reject surrogate characters (U+D800-U+DFFF) */ in STRINGLIB()
783 goto fail; in STRINGLIB()
809 /* reject surrogate characters (U+D800-U+DFFF) */ in STRINGLIB()
810 goto fail; in STRINGLIB()
819 fail: in STRINGLIB()
821 return len - (end - in + 1); in STRINGLIB()