Lines Matching +full:- +full:i

7  *  Tests gleaned from Markus Kuhn's UTF-8 and Unicode FAQ,
8 * and specifically, his UTF-8-test.txt decoder stress test file.
20 {0x0}, /* U-00000000 */
21 {0xc2, 0x80}, /* U-00000080 */
22 {0xe0, 0xa0, 0x80}, /* U-00000800 */
23 {0xf0, 0x90, 0x80, 0x80}, /* U-00010000 */
24 {0xf8, 0x88, 0x80, 0x80, 0x80}, /* U-00200000 */
25 {0xfc, 0x84, 0x80, 0x80, 0x80, 0x80} /* U-04000000 */
29 {0x7f}, /* U-0000007F */
30 {0xdf, 0xbf}, /* U-000007FF */
31 {0xef, 0xbf, 0xbf}, /* U-0000FFFF */
32 {0xf7, 0xbf, 0xbf, 0xbf}, /* U-001FFFFF */
33 {0xfb, 0xbf, 0xbf, 0xbf, 0xbf}, /* U-03FFFFFF */
34 {0xfd, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf} /* U-7FFFFFFF */
38 {0xed, 0x9f, 0xbf}, /* U-0000D7FF */
39 {0xee, 0x80, 0x80}, /* U-0000E000 */
40 {0xef, 0xbf, 0xbd}, /* U-0000FFFD */
41 {0xf4, 0x8f, 0xbf, 0xbf}, /* U-0010FFFF */
42 {0xf4, 0x90, 0x80, 0x80} /* U-00110000 */
66 {0xc2}, /* U-00000080 */
67 {0xe0, 0x80}, /* U-00000800 */
68 {0xf0, 0x80, 0x80}, /* U-00010000 */
69 {0xf8, 0x80, 0x80, 0x80}, /* U-00200000 */
70 {0xfc, 0x80, 0x80, 0x80, 0x80}, /* U-04000000 */
71 {0xdf}, /* U-000007FF */
72 {0xef, 0xbf}, /* U-0000FFFF */
73 {0xf7, 0xbf, 0xbf}, /* U-001FFFFF */
74 {0xfb, 0xbf, 0xbf, 0xbf}, /* U-03FFFFFF */
75 {0xfd, 0xbf, 0xbf, 0xbf, 0xbf} /* U-7FFFFFFF */
140 int i; in main() local
142 if (!setlocale(LC_CTYPE, "C-UTF-8")) in main()
144 printf("Failed to set C-UTF-8 locale.\n"); in main()
148 printf("Set C-UTF-8 locale.\n"); in main()
154 printf("2.1.1: U-%08ld\n", (long) wchar); in main()
158 for (i = 2; i < 7; i++) in main()
160 retval = mbtowc (&wchar, first[i-1], MAX_BYTES); in main()
161 if (retval == i) in main()
162 printf("2.1.%d: U-%08lx\n", i, (long) wchar); in main()
164 printf("2.1.%d: Invalid\n", i); in main()
168 for (i = 1; i < 7; i++) in main()
170 retval = mbtowc (&wchar, last[i-1], MAX_BYTES); in main()
171 if (retval == i) in main()
172 printf("2.2.%d: U-%08lx\n", i, (long) wchar); in main()
174 printf("2.2.%d: Invalid\n", i); in main()
178 for (i = 1; i < 6; i++) in main()
180 retval = mbtowc (&wchar, boundary[i-1], MAX_BYTES); in main()
181 if ((i < 4 && retval == 3) || (i > 3 && retval == 4)) in main()
182 printf("2.3.%d: U-%08lx\n", i, (long) wchar); in main()
184 printf("2.3.%d: Invalid\n", i); in main()
191 printf("3.1.1: U-%08lx\n", (long) wchar); in main()
197 printf("3.1.2: U-%08lx\n", (long) wchar); in main()
201 for(i=2; i< 8; i++) in main()
203 retval = num_invalid(continuation_bytes[i], i); in main()
204 if (retval == -1) in main()
205 printf("3.1.%d: Valid Character Found\n", i+1); in main()
207 printf("3.1.%d: %d Invalid\n", i+1, retval); in main()
210 for(i = 0x80; i < 0xc0; i++) in main()
211 all_continuation_bytes[i-0x80] = i; in main()
213 retval = num_invalid(all_continuation_bytes, 0xc0 - 0x80); in main()
214 if (retval == -1) in main()
220 for(i = 0xc0; i < 0xe0; i++) in main()
221 all_two_byte_seq[i-0xc0] = i; in main()
223 retval = num_invalid(all_two_byte_seq, 0xe0 - 0xc0); in main()
224 if (retval == -1) in main()
229 for(i = 0xe0; i < 0xf0; i++) in main()
230 all_three_byte_seq[i-0xe0] = i; in main()
232 retval = num_invalid(all_three_byte_seq, 0xf0 - 0xe0); in main()
233 if (retval == -1) in main()
238 for(i = 0xf0; i < 0xf8; i++) in main()
239 all_four_byte_seq[i-0xf0] = i; in main()
241 retval = num_invalid(all_four_byte_seq, 0xf8 - 0xf0); in main()
242 if (retval == -1) in main()
247 for(i = 0xf8; i < 0xfc; i++) in main()
248 all_five_byte_seq[i-0xf8] = i; in main()
250 retval = num_invalid(all_five_byte_seq, 0xfc - 0xf8); in main()
251 if (retval == -1) in main()
256 for(i = 0xfc; i < 0xfe; i++) in main()
257 all_six_byte_seq[i-0xfc] = i; in main()
259 retval = num_invalid(all_six_byte_seq, 0xfe - 0xfc); in main()
260 if (retval == -1) in main()
266 for(i = 1; i < 6; i++) in main()
268 retval = mbtowc(&wchar, incomplete_seq[i-1], i); in main()
269 if(retval == -1) in main()
270 printf("3.3.%d: 1 Invalid\n", i); in main()
272 printf("3.3.%d: Valid Character Found\n", i); in main()
275 for(i = 6; i < 11; i++) in main()
277 retval = mbtowc(&wchar, incomplete_seq[i-1], i - 5); in main()
278 if(retval == -1) in main()
279 printf("3.3.%d: 1 Invalid\n", i); in main()
281 printf("3.3.%d: Valid Character Found\n", i); in main()
286 number of bytes read in an invalid multi-byte sequence. */ in main()
290 if(retval == -1) in main()
296 if(retval == -1) in main()
302 if(retval == -1) in main()
309 for(i = 2; i < 7; i++) in main()
311 retval = mbtowc(&wchar, overlong[i-2], i); in main()
312 if(retval == -1) in main()
313 printf("4.1.%d: 1 Invalid\n", i-1); in main()
315 printf("4.1.%d: Valid Character Found\n", i-1); in main()
319 for(i = 2; i < 7; i++) in main()
321 retval = mbtowc(&wchar, overlong_max[i-2], i); in main()
322 if(retval == -1) in main()
323 printf("4.2.%d: 1 Invalid\n", i-1); in main()
325 printf("4.2.%d: Valid Character Found\n", i-1); in main()
329 for(i = 2; i < 7; i++) in main()
331 retval = mbtowc(&wchar, overlong_nul[i-2], i); in main()
332 if(retval == -1) in main()
333 printf("4.3.%d: 1 Invalid\n", i-1); in main()
335 printf("4.3.%d: Valid Character Found\n", i-1); in main()
339 /* 5.1 Single UTF-16 surrogates */ in main()
340 for (i = 1; i < 8; i++) in main()
342 retval = mbtowc(&wchar, single_surrogates[i-1], 3); in main()
343 if(retval == -1) in main()
344 printf("5.1.%d: 1 Invalid\n", i); in main()
346 printf("5.1.%d: Valid Character Found\n", i); in main()
349 /* 5.2 Paired UTF-16 surrogates */ in main()
350 for (i = 1; i < 8; i++) in main()
352 retval = mbtowc(&wchar, paired_surrogates[i-1], 6); in main()
353 if(retval == -1) in main()
354 printf("5.2.%d: 1 Invalid\n", i); in main()
356 printf("5.2.%d: Valid Character Found\n", i); in main()
361 if(retval == -1) in main()
367 if(retval == -1) in main()
376 returns -1 if a valid character is found */
381 int i = 0; in num_invalid() local
388 for(i=0; i<len; t++, i++) in num_invalid()
390 retval = mbtowc (&wchar, t, len - i); in num_invalid()
391 if(retval == -1) in num_invalid()
394 return -1; in num_invalid()