1 //*******************************************************************************
3 // Copyright (C) 2003-2006, International Business Machines
4 // Corporation and others. All Rights Reserved.
6 // file name: conversion.txt
8 // tab size: 8 (not used)
11 // created on: 2003jul15
12 // created by: Markus W. Scherer
14 // ICU resource bundle source file with test data for data-driven conversion tests.
16 //*******************************************************************************
18 conversion:table(nofallback) {
20 Description { "Test data for conversion" }
22 "Test data for data-driven conversion tests in icu/source/test/intltest/convtest.cpp\n"
23 "Run intltest conversion\n"
25 "Charset names starting with '*' are for testdata names.\n"
27 "ICU callbacks are specified as strings with pairs of characters, each optional.\n"
28 "Callback function - '?'=Sub '0'=Skip '.'=Stop '&'=Escape\n"
29 "Callback option - a letter is passed in directly as const char * see ucnv_err.h\n"
30 "Empty string: Sub callback with NULL option\n"
32 "In order to specify a charset substitution character (for ucnv_setSubstChars()),\n"
33 "add a NUL (U+0000) to the callback string followed by the subchar bytes as Latin-1\n"
34 "characters. For example, for a Sub callback with no option and a subchar of FC FC,\n"
35 "use the string \"?\x00\xFC\xFC\"\n"
37 "In order to specify a substitution string (for ucnv_setSubstString()),\n"
38 "add an '=' to the callback string followed by the substitution string.\n"
39 "For example, for a Sub callback with no option and a substitution string\n"
40 "of \"ab\", use the string \"?=ab\"\n"
42 "fallbacks: per-direction boolean, currently only for fromUnicode; see Jitterbug 2401\n"
44 "errorCode: (empty)==zero | invalid | illegal | truncated | illesc | unsuppesc\n"
49 Headers { "charset", "bytes", "unicode", "offsets", "flush", "fallbacks", "errorCode", "callback", "invalidChars" }
51 // improve coverage of unrolled loops in ucnvmbcs.c/ucnv_MBCSSingleToBMPWithOffsets()
54 :bin{ 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f2021222324252627 },
55 "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\x22#$%&'",
56 :intvector{ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39 },
57 :int{1}, :int{0}, "", "?", :bin{""}
59 // test that ISO-2022-JP encodes ASCII as itself
62 :bin{ 3f4041424344454647 },
64 :intvector{ 0,1,2,3,4,5,6,7,8 },
65 :int{1}, :int{1}, "", "?", :bin{""}
67 // test that ISO-2022-CN encodes ASCII as itself
70 :bin{ 3f4041424344454647 },
72 :intvector{ 0,1,2,3,4,5,6,7,8 },
73 :int{1}, :int{1}, "", "?", :bin{""}
78 // truncated, partial escape sequence
81 :bin{ 1b }, "", :intvector{},
82 :int{1}, :int{1}, "truncated", ".", :bin{ 1b }
86 :bin{ 1b24 }, "", :intvector{},
87 :int{1}, :int{1}, "truncated", ".", :bin{ 1b24 }
91 :bin{ 1b2429 }, "", :intvector{},
92 :int{1}, :int{1}, "truncated", ".", :bin{ 1b2429 }
94 // complete escape sequence but nothing else
97 :bin{ 1b242943 }, "", :intvector{},
98 :int{1}, :int{1}, "", ".", :bin{""}
102 :bin{ 1b2429430e }, "", :intvector{},
103 :int{1}, :int{1}, "", ".", :bin{""}
105 // escape plus ASCII character
108 :bin{ 1b24294341 }, "A", :intvector{ 4 },
109 :int{1}, :int{1}, "", ".", :bin{""}
111 // escape plus incomplete DBCS character
114 :bin{ 1b2429430e41 }, "", :intvector{},
115 :int{1}, :int{1}, "truncated", ".", :bin{ 41 }
117 // all complete with DBCS character
120 :bin{ 1b2429430e4141 }, "\uc88b", :intvector{ 5 },
121 :int{1}, :int{1}, "", ".", :bin{""}
123 // more complicated example
126 :bin{ 411b242943420e4141affe0f43 },
128 :intvector{ 0, 5, 7, 9, 9, 9, 9, 9, 9, 9, 9, 12 },
129 :int{1}, :int{1}, "", "&", :bin{""}
132 // truncated, partial escape sequence
135 :bin{ 1b }, "", :intvector{},
136 :int{1}, :int{1}, "truncated", ".", :bin{ 1b }
140 :bin{ 1b24 }, "", :intvector{},
141 :int{1}, :int{1}, "truncated", ".", :bin{ 1b24 }
145 :bin{ 1b2429 }, "", :intvector{},
146 :int{1}, :int{1}, "truncated", ".", :bin{ 1b2429 }
148 // complete escape sequence but nothing else
151 :bin{ 1b242943 }, "", :intvector{},
152 :int{1}, :int{1}, "", ".", :bin{""}
156 :bin{ 1b2429430e }, "", :intvector{},
157 :int{1}, :int{1}, "", ".", :bin{""}
159 // escape plus ASCII character
162 :bin{ 1b24294341 }, "A", :intvector{ 4 },
163 :int{1}, :int{1}, "", ".", :bin{""}
165 // escape plus incomplete DBCS character
168 :bin{ 1b2429430e41 }, "", :intvector{},
169 :int{1}, :int{1}, "truncated", ".", :bin{ 41 }
171 // all complete with DBCS character
174 :bin{ 1b2429430e4141 }, "\uc88b", :intvector{ 5 },
175 :int{1}, :int{1}, "", ".", :bin{""}
177 // more complicated example
180 :bin{ 411b242943420e4141affe0f43 },
182 :intvector{ 0, 5, 7, 9, 9, 9, 9, 9, 9, 9, 9, 12 },
183 :int{1}, :int{1}, "", "&", :bin{""}
188 // truncated, partial escape sequence
191 :bin{ 1b }, "", :intvector{},
192 :int{1}, :int{1}, "truncated", ".", :bin{ 1b }
196 :bin{ 1b24 }, "", :intvector{},
197 :int{1}, :int{1}, "truncated", ".", :bin{ 1b24 }
199 // complete escape sequence but nothing else
202 :bin{ 1b2442 }, "", :intvector{},
203 :int{1}, :int{1}, "", ".", :bin{""}
205 // escape plus incomplete DBCS character
208 :bin{ 1b244241 }, "", :intvector{},
209 :int{1}, :int{1}, "truncated", ".", :bin{ 41 }
211 // all complete with DBCS character
214 :bin{ 1b24424141 }, "\u758f", :intvector{ 3 },
215 :int{1}, :int{1}, "", ".", :bin{""}
217 // test the G2 designator & SS2 shift
220 :bin{ 431b2e46461b244241411b4e4e353f }, "CF\u758f\u039e\u7591", :intvector{ 0, 4, 8, 12, 13 },
221 :int{1}, :int{1}, "", ".", :bin{""}
223 // JIS7 with Katakana
226 :bin{ 41420e41420f4142 }, "AB\uff81\uff82AB", :intvector{ 0, 1, 3, 4, 6, 7 },
227 :int{1}, :int{1}, "", ".", :bin{""}
229 // JIS8 with Katakana
232 :bin{ 41c15c1b284a5cc242 }, "A\uff81\\\xa5\uff82B", :intvector{ 0, 1, 2, 6, 7, 8 },
233 :int{1}, :int{1}, "", ".", :bin{""}
238 // truncated, partial escape sequence
240 "ISO_2022,locale=zh,version=1",
241 :bin{ 1b }, "", :intvector{},
242 :int{1}, :int{1}, "truncated", ".", :bin{ 1b }
245 "ISO_2022,locale=zh,version=1",
246 :bin{ 1b24 }, "", :intvector{},
247 :int{1}, :int{1}, "truncated", ".", :bin{ 1b24 }
250 "ISO_2022,locale=zh,version=1",
251 :bin{ 1b2429 }, "", :intvector{},
252 :int{1}, :int{1}, "truncated", ".", :bin{ 1b2429 }
254 // complete escape sequence but nothing else
256 "ISO_2022,locale=zh,version=1",
257 :bin{ 1b242941 }, "", :intvector{},
258 :int{1}, :int{1}, "", ".", :bin{""}
261 "ISO_2022,locale=zh,version=1",
262 :bin{ 1b2429410e }, "", :intvector{},
263 :int{1}, :int{1}, "", ".", :bin{""}
265 // escape plus ASCII character
267 "ISO_2022,locale=zh,version=1",
268 :bin{ 1b24294141 }, "\x41", :intvector{ 4 },
269 :int{1}, :int{1}, "", ".", :bin{""}
271 // escape plus incomplete DBCS character
273 "ISO_2022,locale=zh,version=1",
274 :bin{ 1b2429410e41 }, "", :intvector{},
275 :int{1}, :int{1}, "truncated", ".", :bin{ 41 }
277 // all complete with DBCS character
279 "ISO_2022,locale=zh,version=1",
280 :bin{ 1b2429410e4141 }, "\u4eae", :intvector{ 5 },
281 :int{1}, :int{1}, "", ".", :bin{""}
283 // ISO-2022-CN-EXT with all subcharsets and shifts and with supplementary code points
286 :bin{ 1b2429411b242a480e41411b2429457e7c1b4e70341b242b4d1b2429477c341b4f664c2421 },
287 "\u4eae\u9f82\u56cd\u56cc\U0002a6d6\x30",
288 :intvector{ 9, 15, 19, 29, 33, 33, 35 },
289 :int{1}, :int{1}, "", ".", :bin{""}
292 // illegal and unsupported escape sequences
293 // SS2 without designator: illegal
296 :bin{ 411b4e2121 }, "\x41", :intvector{ 0 },
297 :int{1}, :int{1}, "illesc", ".", :bin{ 1b4e }
299 // G3 designator: recognized, but not supported for -CN (only for -CN-EXT)
302 :bin{ 411b242b491b4f2121 }, "\x41", :intvector{ 0 },
303 :int{1}, :int{1}, "unsuppesc", ".", :bin{ 1b242b49 }
307 // [U_ENABLE_GENERIC_ISO_2022]
308 // The _generic_ ISO-2022 converter is disabled starting 2003-dec-03 (ICU 2.8).
309 // For details see the icu mailing list from 2003-dec-01 and the ucnv2022.c file.
310 // Language-specific variants of ISO-2022 continue to be available as listed below.
313 // :bin{ 0008090a0d1a1c1f203f415c7d7e7f },
314 // "\x00\x08\t\n\r\x1a\x1c\x1f ?A\\}~\x7f",
315 // :intvector{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 },
316 // :int{1}, :int{1}, "", ".", :bin{""}
319 // DBCS-only extensions
322 :bin{ 617eece9b2eb },
323 "\x61\x7e\u4e00\ub000",
324 :intvector{ 0, 1, 2, 4 },
325 :int{1}, :int{1}, "", "?", :bin{""}
330 :bin{ 617eece9b2eb },
331 "\ufffd\u4e00\ub000",
332 :intvector{ 0, 2, 4 },
333 :int{1}, :int{1}, "", "?", :bin{""}
338 :bin{ 430e4395ecc1404042e1 },
339 "\ufffd\u30C8\u30C8\u309A\u3000\u20ac",
340 :intvector{ 0, 2, 4, 4, 6, 8 },
341 :int{1}, :int{0}, "", "?", :bin{""}
346 :bin{ 430e4395ecc140400fe1 },
347 "\uff62\u30C8\u30C8\u309A\u3000\u20ac",
348 :intvector{ 0, 2, 4, 4, 6, 9 },
349 :int{1}, :int{0}, "", "?", :bin{""}
355 :bin{ 430e4395ecc1 },
356 "\uff63\u30C8\u30C8\u309A",
357 :intvector{ 0, 2, 4, 4 },
358 :int{1}, :int{0}, "", "?", :bin{""}
363 :bin{ ececec8bec8cec8d4386ecb5ecb6ecb7 },
364 "\ufffd\u31f6\u31f7\u31f8\u30ab\u304b\u309a\u304d\u309a\u304f\u309a",
365 :intvector{ 0, 2, 4, 6, 8, 10, 10, 12, 12, 14, 14 },
366 :int{1}, :int{0}, "", "?", :bin{""}
371 :bin{ 43860eececec8bec8cec8d4386ecb5ecb6ecb7ecc10fec },
372 "\uff63\uff76\ufffd\u31f6\u31f7\u31f8\u30ab\u304b\u309a\u304d\u309a\u304f\u309a\u30C8\u309A\x1a",
373 :intvector{ 0, 1, 3, 5, 7, 9, 11, 13, 13, 15, 15, 17, 17, 19, 19, 22 },
374 :int{1}, :int{0}, "", "?", :bin{""}
379 :bin{ 00050601020b0701020a01020c },
380 "\u20ac\x05\x06\x0b\U00101234\U00023456\ufffd",
381 :intvector{ 0, 1, 2, 3, 6, 6, 7, 7, 10 },
382 :int{1}, :int{0}, "", "?", :bin{""}
385 // normal conversions
388 :bin{ 310000d801dc00d902dc320000d8330001dc3400 },
389 "1\U00010001\U000500022\ufffd3\ufffd4",
390 :intvector{ 0, 2, 2, 6, 6, 10, 12, 14, 16, 18 },
391 :int{1}, :int{0}, "", "?", :bin{""}
393 { "UTF-16LE", :bin{ 00 }, "", :intvector{}, :int{1}, :int{0}, "truncated", ".", :bin{ 00 } }
394 { "UTF-16LE", :bin{ 00d800 }, "", :intvector{}, :int{1}, :int{0}, "truncated", ".", :bin{ 00d800 } }
398 :bin{ 0031d800dc01d900dc020032d8000033dc010034 },
399 "1\U00010001\U000500022\ufffd3\ufffd4",
400 :intvector{ 0, 2, 2, 6, 6, 10, 12, 14, 16, 18 },
401 :int{1}, :int{0}, "", "?", :bin{""}
403 { "UTF-16BE", :bin{ 00 }, "", :intvector{}, :int{1}, :int{0}, "truncated", ".", :bin{ 00 } }
404 { "UTF-16BE", :bin{ d800dc }, "", :intvector{}, :int{1}, :int{0}, "truncated", ".", :bin{ d800dc } }
406 // e4b8 is a partial sequence
407 { "UTF-8", :bin{ 31e4ba8ce4b8 }, "1\u4e8c", :intvector{ 0, 1 }, :int{1}, :int{0}, "truncated", ".", :bin{ e4b8 } }
408 { "UTF-8", :bin{ 31e4ba8ce4b8 }, "1\u4e8c\ufffd", :intvector{ 0, 1, 4 }, :int{1}, :int{0}, "", "?", :bin{""} }
410 // LMBCS with escape callback (1292a0 is unassigned)
413 :bin{ 12c9501292a01292a1 },
414 "\u4e2e%X12%X92%XA0\ue5c4",
415 :intvector{ 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 6 },
416 :int{1}, :int{0}, "", "&", :bin{""}
419 // IMAP-mailbox-name with SUB
420 // a<DEL> a&AB~ a&AB\x0c a&AB- a&AB. a&.
423 :bin{ 617f612641427e612641420c612641422d612641422e61262e },
424 "a\ufffda\ufffda\ufffda\ufffda\ufffda\ufffd",
425 :intvector{ 0, 1, 2, 4, 7, 9, 12, 14, 17, 19, 22, 23 },
426 :int{1}, :int{0}, "", "?", :bin{""}
429 // using testdata_test1.cnv
430 { "*test1", :bin{ 000506070809 }, "\u20ac\x05\x06\U00101234\ufffd\ufffd", :intvector{ 0, 1, 2, 3, 3, 4, 5 }, :int{1}, :int{0}, "", "", :bin{""} }
432 // surrogates in CESU-8
433 { "CESU-8", :bin{ eda080eda081edb081 }, "\ud800\U00010401", :intvector{ 0, 3, 6 }, :int{1}, :int{0}, "", "", :bin{""} }
434 // e080 is a partial sequence
435 { "UTF-8", :bin{ 31ffe4ba8ce08061 }, "1\ufffd\u4e8c\ufffda", :intvector{ 0, 1, 2, 5, 7 }, :int{0}, :int{0}, "", "", :bin{ e080 } }
436 // fbbfbfbfbf exceedes U+10ffff
437 { "UTF-8", :bin{ 31fbbfbfbfbf61 }, "1\ufffda", :intvector{ 0, 1, 6 }, :int{0}, :int{0}, "", "", :bin{ fbbfbfbfbf } }
439 // lead byte a2 without trail byte
440 { "ibm-1363", :bin{ a2aea2 }, "\u00a1", :intvector{ 0 }, :int{1}, :int{0}, "truncated", ".", :bin{ a2 } }
441 { "ibm-1363", :bin{ a2aea2 }, "\u00a1\u001a", :intvector{ 0, 2 }, :int{1}, :int{0}, "", "?", :bin{""} }
443 // simple sample, no error handling
444 { "UTF-8", :bin{ 61F48FBFBF }, "a\U0010FFFF", :intvector{ 0, 1, 1 }, :int{1}, :int{0}, "", "", :bin{""} }
448 // --------------------------------------------------------------------- ***
451 Headers { "charset", "unicode", "bytes", "offsets", "flush", "fallbacks", "errorCode", "callback", "invalidUChars" }
455 "1\U00010001\u0085\U000500022\ud8003\udc014\ue001",
456 :bin{ 310be0008102050fd900dc02e7320efffd330efffd34186881 },
457 :intvector{ 0,1,1,1,1,3,3,4,4,4,4,4,6,6,7,7,7,8,9,9,9,10,11,11,11 },
458 :int{1}, :int{0}, "", "?", ""
460 // Test substitution strings.
462 "windows-1252", // stateless MBCS with WriteSub(), should internally set char *
464 :bin{ 61402421402463 },
465 :intvector{ 0,1,1,1,1,1,2 },
466 :int{1}, :int{0}, "", "?=@$!@$", ""
469 "ibm-930", // stateful MBCS
470 "a\ufdd0\u4e00\ufdd0e",
471 :bin{ 620e4bce0f400e45414bce0f4066 },
472 :intvector{ 0,1,1,1,1,1,2,2,2,3,3,3,3,4 },
473 :int{1}, :int{0}, "", "?=\u4e01 ", ""
477 "a\x1bc", // Unicode ESC must not occur as a character
480 :int{1}, :int{0}, "", "?=", "" // empty substitution string
484 "a\x1bc", // Unicode ESC must not occur as a character
486 :intvector{ 0,1,1,2 },
487 :int{1}, :int{0}, "", "?= ", ""
491 "a\x1bc", // Unicode ESC must not occur as a character
492 :bin{ 611b2429410e523b0f2063 },
493 :intvector{ 0,1,1,1,1,1,1,1,1,1,2 },
494 :int{1}, :int{0}, "", "?=\u4e00 ", ""
499 :bin{ 61402421402463 },
500 :intvector{ 0,1,1,1,1,1,2 },
501 :int{1}, :int{0}, "", "?=@$!@$", ""
503 // ISO 2022-CN: test a single-byte subchar, j5171
506 "a\x1bc", // Unicode ESC must not occur as a character
509 :int{1}, :int{0}, "", "?\x00\x21", ""
511 // UTF-16/32: do not output a BOM if there is no data at all
517 :int{1}, :int{1}, "", "?", ""
524 :int{1}, :int{1}, "", "?", ""
527 // do not convert SO/SI/ESC
530 "A\x0eB\x0f\x09\x1bC",
531 :bin{ 411a421a091a43 },
532 :intvector{ 0,1,2,3,4,5,6 },
533 :int{1}, :int{1}, "", "?", ""
537 "A\x0eB\x0f\x09\x1bC",
538 :bin{ 411a421a091a43 },
539 :intvector{ 0,1,2,3,4,5,6 },
540 :int{1}, :int{1}, "", "?", ""
544 "A\x0eB\x0f\x09\x1bC",
545 :bin{ 1b242943411a421a091a43 },
546 :intvector{ -1,-1,-1,-1,0,1,2,3,4,5,6 },
547 :int{1}, :int{1}, "", "?", ""
551 "A\x0eB\x0f\x09\x1bC",
552 :bin{ 1b242943411a421a091a43 },
553 :intvector{ -1,-1,-1,-1,0,1,2,3,4,5,6 },
554 :int{1}, :int{1}, "", "?", ""
557 // test ISO 8859-1/7 vs. JIS X 0201
560 "?@A\u00e4\u03b1\u203EB",
561 :bin{ 3f40411B2E411B4E641B2E461B4E611B284A7E421B2842 },
562 :intvector{ 0,1,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,6,6,6,6 },
563 :int{1}, :int{1}, "", "?", ""
566 // Improve ucnv_ext.c code coverage:
567 // There will be a partial match up to the lead surrogate of U+603ff
568 // which then results in one more unit in the prefetch buffer
569 // than the match length when converting one code unit at a time.
570 // See ucnv_extContinueMatchFromU() comment
571 // "the match did not use all of preFromU[] - keep the rest for replay"
574 "\U00101234\U00101234\U00050005\U000603ff",
575 :bin{ 07070001020e05ff },
576 :intvector{ 0, 2, 2, 2, 2, 2, 2, 6 },
577 :int{1}, :int{0}, "", "?", ""
580 // test that ISO-2022-JP encodes ASCII as itself
584 :bin{ 3f4041424344454647 },
585 :intvector{ 0,1,2,3,4,5,6,7,8 },
586 :int{1}, :int{1}, "", "?", ""
588 // test that ISO-2022-CN encodes ASCII as itself
592 :bin{ 3f4041424344454647 },
593 :intvector{ 0,1,2,3,4,5,6,7,8 },
594 :int{1}, :int{1}, "", "?", ""
597 // moved from cintltst /tsconv/nccbtst/TestSkipCallBack
601 :bin{ 1b2442212121221b2842 },
602 :intvector{ 0,0,0,0,0,2,2,2,2,2 },
603 :int{1}, :int{1}, "", "0", ""
605 // moved from cintltst /tsconv/nccbtst/TestSubCallBack
609 :bin{ 411a421a1b244221211b2842 },
610 :intvector{ 0,1,2,3,4,4,4,4,4,4,4,4 },
611 :int{1}, :int{1}, "", "?", ""
613 // moved from cintltst /tsconv/nccbtst/TestSubWithValueCallBack
617 :bin{ 41255530304539422555303045391b244221211b2842 },
618 :intvector{ 0,1,1,1,1,1,1,2,3,3,3,3,3,3,4,4,4,4,4,4,4,4 },
619 :int{1}, :int{1}, "", "&", ""
623 "\u4e00\u3712\u4e01",
624 :bin{ 1b2429410e523b0f2555333731320e36210f },
625 :intvector{ 0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2 },
626 :int{1}, :int{1}, "", "&", ""
631 :bin{ 412555333731321b2429410e523b0f },
632 :intvector{ 0,1,1,1,1,1,1,2,2,2,2,2,2,2,2 },
633 :int{1}, :int{1}, "", "&", ""
637 "\u3000\u3712\u3001",
638 :bin{ 1b2429410e21210f2555333731320e21220f },
639 :intvector{ 0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2 },
640 :int{1}, :int{1}, "", "&", ""
643 // moved from cintltst /tsconv/nucnvtst/TestJIS
646 "\uFF81\uFF82\u30EC\u30ED\u30EE\u30EF\uFF93\uFF94\uFF95\uFF96\uFF97\uFF98",
647 :bin{ 1b244225412544256c256d256e256F25622564256625682569256a1b2842 },
648 :intvector{ 0,0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,11,11,11 },
649 :int{1}, :int{1}, "", "?", ""
653 "\uFF81\uFF82\u30EC\u30ED\u30EE\u30EF\uFF93\uFF94\uFF95\uFF96\uFF97\uFF98",
654 :bin{ 0e41420f1b2442256c256d256e256F0e5354555657580f1b2842 },
655 :intvector{ 0,0,1,2,2,2,2,2,2,3,3,4,4,5,5,6,6,7,8,9,10,11,11,11,11,11 },
656 :int{1}, :int{1}, "", "?", ""
660 "\uFF81\uFF82\u30EC\u30ED\u30EE\u30EF\uFF93\uFF94\uFF95\uFF96\uFF97\uFF98",
661 :bin{ C1C21b2442256c256d256e256F1b284AD3D4D5D6D7D81b2842 },
662 :intvector{ 0,1,2,2,2,2,2,3,3,4,4,5,5,6,6,6,6,7,8,9,10,11,11,11,11 },
663 :int{1}, :int{1}, "", "?", ""
666 // moved from cintltst /tsconv/ncnvtst/TestErrorBehaviour
669 "\u3000\x50\udc01\u3001",
670 :bin{ 1B244221211B2842501A1B24422122 },
671 :intvector{ 0,0,0,0,0,1,1,1,1,2,3,3,3,3,3 },
672 :int{0}, :int{1}, "", "?", "\udc01"
676 "\u3000\x50\udc01\u3001",
677 :bin{ 1B244221211B2842501A1B244221221b2842 },
678 :intvector{ 0,0,0,0,0,1,1,1,1,2,3,3,3,3,3,3,3,3 },
679 :int{1}, :int{1}, "", "?", ""
683 "\x61\u4e00\udc01\u4e00",
684 :bin{ 1b242943610e6c690f1a0e6c69 },
685 :intvector{ -1,-1,-1,-1,0,1,1,1,2,2,3,3,3 },
686 :int{0}, :int{1}, "", "?", "\udc01"
690 "\x61\u4e00\udc01\u4e00",
691 :bin{ 1b242943610e6c690f1a0e6c690f },
692 :intvector{ -1,-1,-1,-1,0,1,1,1,2,2,3,3,3,3 },
693 :int{1}, :int{1}, "", "?", ""
699 "AB\uc88b\U00050005\uacccC",
700 :bin{ 1b24294341420e41410f7b552b35303030357d0e306a0f43 },
701 :intvector{ -1,-1,-1,-1,0,1,2,2,2,3,3,3,3,3,3,3,3,3,3,5,5,5,6,6 },
702 :int{1}, :int{1}, "", "&U", ""
706 "AB\uc88b\U00050005\uacccC",
707 :bin{ 1b24294341420e41410f1a0e306a0f43 },
708 :intvector{ -1,-1,-1,-1,0,1,2,2,2,3,3,5,5,5,6,6 },
709 :int{1}, :int{1}, "", "?\x00\x1a", ""
713 "AB\uc88b\U00050005\uacccC",
714 :bin{ 1b24294341420e41412f7e306a0f43 },
715 :intvector{ -1,-1,-1,-1,0,1,2,2,2,3,3,5,5,6,6 },
716 :int{1}, :int{1}, "", "?", ""
720 "AB\uc88b\U00050005\uaccc",
721 :bin{ 1b24294341420e41412f7e306a0f },
722 :intvector{ -1,-1,-1,-1,0,1,2,2,2,3,3,5,5,5 },
723 :int{1}, :int{1}, "", "?", ""
727 "AB\uc88b\U00050005\uacccC",
728 :bin{ 1b24294341420e41410f7b552b35303030357d0e306a0f43 },
729 :intvector{ -1,-1,-1,-1,0,1,2,2,2,3,3,3,3,3,3,3,3,3,3,5,5,5,6,6 },
730 :int{1}, :int{1}, "", "&U", ""
734 "AB\uc88b\U00050005\uacccC",
735 :bin{ 1b24294341420e41410f1a0e306a0f43 },
736 :intvector{ -1,-1,-1,-1,0,1,2,2,2,3,3,5,5,5,6,6 },
737 :int{1}, :int{1}, "", "?", ""
741 "AB\uc88b\U00050005\uacccC",
742 :bin{ 1b24294341420e41412f7e306a0f43 },
743 :intvector{ -1,-1,-1,-1,0,1,2,2,2,3,3,5,5,6,6 },
744 :int{1}, :int{1}, "", "?\x00\x2f\x7e", ""
748 "AB\uc88b\U00050005\uaccc",
749 :bin{ 1b24294341420e41412f7e306a0f },
750 :intvector{ -1,-1,-1,-1,0,1,2,2,2,3,3,5,5,5 },
751 :int{1}, :int{1}, "", "?\x00\x2f\x7e", ""
754 // ISO-2022-JP-2 with G2 designator & SS2 shift
757 "CF\u758f\u038f\u7591",
758 :bin{ 43461b244241411b2e461b4e3f353f1b2842 },
759 :intvector{ 0,1,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4 },
760 :int{1}, :int{1}, "", ".", ""
762 // JIS7 with Katakana
766 :bin{ 41420e41420f4142 },
767 :intvector{ 0,1,2,2,3,4,4,5 },
768 :int{1}, :int{1}, "", ".", ""
770 // JIS7 with shift to ASCII at the very end
774 :bin{ 41420e41420f },
775 :intvector{ 0,1,2,2,3,3 },
776 :int{1}, :int{1}, "", ".", ""
778 // JIS8 with Katakana
781 "A\uff81\\\xa5\uff82B",
782 :bin{ 41c15c1b284a5cc2421b2842 },
783 :intvector{ 0,1,2,3,3,3,3,4,5,5,5,5 },
784 :int{1}, :int{1}, "", ".", ""
787 // ISO-2022-CN-EXT with all subcharsets and shifts and with supplementary code points
790 "\u4eae\u9f82\u56cd\u56cc\U0002a6d6\x30",
791 :bin{ 1b2429410e41411b2429457e7c1b242a481b4e70341b2429477c341b242b4d1b4f664c0f30 },
792 :intvector{ 0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,4,4,6,6 },
793 :int{1}, :int{1}, "", ".", ""
795 // ISO-2022-CN-EXT with shift to ASCII at the very end
798 "\u4eae\u9f82\u56cd\u56cc\U0002a6d6",
799 :bin{ 1b2429410e41411b2429457e7c1b242a481b4e70341b2429477c341b242b4d1b4f664c0f },
800 :intvector{ 0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4 },
801 :int{1}, :int{1}, "", ".", ""
803 // ISO-2022-CN-EXT without flush so do not shift to ASCII at the very end
806 "\u4eae\u9f82\u56cd\u56cc\U0002a6d6",
807 :bin{ 1b2429410e41411b2429457e7c1b242a481b4e70341b2429477c341b242b4d1b4f664c },
808 :intvector{ 0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,4,4 },
809 :int{0}, :int{1}, "", ".", ""
812 // windows-936 vs. ibm-1386
815 "\x1a\u20ac\u5555\x80\x81\U00055555",
816 :bin{ 7fa2e3dffb7f7fa1a1 },
817 :intvector{ 0, 1, 1, 2, 2, 3, 4, 5, 5 },
818 :int{1}, :int{1}, "", "?", ""
822 "\x1a\u20ac\u5555\x80\x81\U00055555",
823 :bin{ 1a80dffb3f3f3f },
824 :intvector{ 0, 1, 2, 2, 3, 4, 5 },
825 :int{1}, :int{1}, "", "?", ""
828 // verify that if a conversion table does not have any mapping for U+0000,
829 // then there will not even be a phantom fallback to 00
835 :int{1}, :int{1}, "", "?", ""
843 :int{1}, :int{1}, "", "?", ""
846 // extension in testdata
852 :int{1}, :int{1}, "", "?", ""
855 // DBCS-only extensions
858 "\x61\uffa1\u2015\ub000",
859 :bin{ 611aa1aab2eb },
860 :intvector{ 0, 1, 2, 2, 3, 3 },
861 :int{1}, :int{1}, "", "?", ""
866 "\x61\uffa1\u2015\ub000",
867 :bin{ affeaffeaffeb2eb },
868 :intvector{ 0, 0, 1, 1, 2, 2, 3, 3 },
869 :int{1}, :int{1}, "", "?", ""
874 "\uff63\u30C8\u30C8\u309A\u3000\x41\u20ac\x0a",
875 :bin{ 430e4395ecc140400fc1e115 },
876 :intvector{ 0, 1, 1, 1, 2, 2, 4, 4, 5, 5, 6, 7 },
877 :int{1}, :int{0}, "", "?", ""
882 "\uff63\u30C8\u30C8\u309A\u3000\x41\u20ac\x0a",
883 :bin{ fefe4395ecc14040fefe42e1fefe },
884 :intvector{ 0, 0, 1, 1, 2, 2, 4, 4, 5, 5, 6, 6, 7, 7 },
885 :int{1}, :int{0}, "", "?", ""
890 "\uff63\u30C8\u30C8\u309A\u3000\x41\u20ac\x0a",
891 :bin{ 440e4395ecc140400fc1e125 },
892 :intvector{ 0, 1, 1, 1, 2, 2, 4, 4, 5, 5, 6, 7 },
893 :int{1}, :int{0}, "", "?", ""
896 // <subchar1> from |2 mappings
899 "\x0e\x0f\u0901\U00050000\uffe8\uffee",
900 :bin{ 3f3f0efefefefe0f3f3f },
901 :intvector{ 0, 1, 2, 2, 2, 3, 3, 5, 5, 6 },
902 :int{1}, :int{1}, "", "?", ""
905 // <subchar1> from |2 mappings, and also contains a fallback to 00
908 "\u20ac\u20ad\U00050005\U00023456\U0010ffff\x30",
909 :bin{ 0000e10102030affff },
910 :intvector{ 0, 1, 2, 4, 4, 4, 4, 6, 8 },
911 :int{1}, :int{1}, "", "?", ""
914 // setting a <subchar> resets the <subchar1>
917 "\u20ac\u20ad\U00050005\U00023456\U0010ffff\x30",
918 :bin{ 00000102030f0102030a0102030f0102030f },
919 :intvector{ 0, 1, 2, 2, 2, 2, 4, 4, 4, 4, 6, 6, 6, 6, 8, 8, 8, 8 },
920 :int{1}, :int{1}, "", "?\x00\x01\x02\x03\x0f", ""
923 // fallback to 00 with old single-byte data structure
926 "\u20ac\u20ad\U00101234\U00050000",
928 :intvector{ 0, 1, 2, 4 },
929 :int{1}, :int{1}, "", "?", ""
935 "\u025a\u025a\u0300\u025a\u0301\u025a\u0302\uffe8\U0002a0f9",
936 :bin{ 0ed896eccaeccbd896ea530f3f0eb7c20f },
937 :intvector{ 0, 0, 0, 1, 1, 3, 3, 5, 5, 6, 6, 7, 7, 8, 8, 8, 8 },
938 :int{1}, :int{0}, "", "?", ""
943 "\xc4\xc4\xc4\U00101234\xc4\xc4\U00101234\x05",
944 :bin{ ffffff070501020c },
945 :intvector{ 0, 1, 2, 3, 5, 5, 5, 5 },
946 :int{1}, :int{0}, "", "?", ""
951 "\U00101234\U00101234\U00050005\U00101234\U00050005\U00060006",
952 :bin{ 07070001020e05070001020f09 },
953 :intvector{ 0, 2, 2, 2, 2, 2, 2, 6, 6, 6, 6, 6, 6 },
954 :int{1}, :int{0}, "", "?", ""
957 // normal conversions
960 "1\U00010001\U000500022\ud8003\udc014",
961 :bin{ 310000d801dc00d902dc3200fdff3300fdff3400 },
962 :intvector{ 0, 0, 1, 1, 1, 1, 3, 3, 3, 3, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9 },
963 :int{1}, :int{0}, "", "?", ""
965 { "UTF-16LE", "\ud800", :bin{""}, :intvector{}, :int{1}, :int{0}, "truncated", ".", "\ud800" }
969 "1\U00010001\U000500022\ud8003\udc014",
970 :bin{ 0031d800dc01d900dc020032fffd0033fffd0034 },
971 :intvector{ 0, 0, 1, 1, 1, 1, 3, 3, 3, 3, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9 },
972 :int{1}, :int{0}, "", "?", ""
974 { "UTF-16BE", "\ud800", :bin{""}, :intvector{}, :int{1}, :int{0}, "truncated", ".", "\ud800" }
978 "1\U00010001\u00082\ud8003\udc014\ue001",
979 :bin{ 310be000810108320efffd330efffd34186881 },
980 :intvector{ 0, 1, 1, 1, 1, 3, 3, 4, 5, 5, 5, 6, 7, 7, 7, 8, 9, 9, 9 },
981 :int{1}, :int{0}, "", "?", ""
987 "A\u0901\U00023456\u0902B\U00023456C",
988 :bin{ 41ef42a1255544383444255544433536a24225554438344425554443353643 },
1000 :int{1}, :int{0}, "", "&", ""
1003 // escape callback (hex)
1006 "\u3000\U00023456\u3001\U00023456B\u901c",
1007 :bin{ 1b244221211b284226237832333435363b1b244221221b284226237832333435363b42262378393031433b },
1010 1,1,1,1,1,1,1,1,1,1,1,1,
1012 4,4,4,4,4,4,4,4,4,4,4,4,
1016 :int{1}, :int{0}, "", "&X", ""
1022 "$\x7f\x80\u01f9\u20ac\u4e00\u9fa6\uffff\U00010000\U0010ffff",
1023 :bin{ 247f81308130a8bfa2e3d2bb82358f338431a43990308130e3329a35 },
1024 :intvector{ 0, 1, 2, 2, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 10, 10, 10, 10 },
1025 :int{1}, :int{0}, "", "?", ""
1029 { "ibm-930", "\u6D63\u6D64\u6D65\u6D66", :bin{ 0e5d5f5d63466b0f }, :intvector{ 0, 0, 0, 1, 1, 3, 3, 3 }, :int{1}, :int{0}, "", "0", "" }
1030 { "ibm-930", "\u6D63\u6D64\ud89a\u6D66", :bin{ 0e5d5f5d63466b0f }, :intvector{ 0, 0, 0, 1, 1, 3, 3, 3 }, :int{1}, :int{0}, "", "0", "" }
1031 { "ibm-930", "\u6D63\u6D64\ud89a\u6D66", :bin{ 0e5d5f5d63 }, :intvector{ 0, 0, 0, 1, 1 }, :int{1}, :int{0}, "illegal", "0i", "\ud89a" }
1033 // sub callback for supplementary code point
1034 { "LATIN1", "1\U000104012", :bin{ 311a32 }, :intvector{ 0, 1, 3 }, :int{1}, :int{0}, "", "", "" }
1035 { "ibm-920", "1\U000104012", :bin{ 311a32 }, :intvector{ 0, 1, 3 }, :int{1}, :int{0}, "", "", "" }
1037 // sub callback with AA as subchar
1038 { "ibm-920", "1\U000104012", :bin{ 31AA32 }, :intvector{ 0, 1, 3 }, :int{1}, :int{0}, "", "?\x00\xAA", "" }
1040 // same but not flushing
1041 { "LATIN1", "1\U000104012", :bin{ 311a32 }, :intvector{ 0, 1, 3 }, :int{0}, :int{0}, "", "", "\U00010401" }
1042 { "ibm-920", "1\U000104012", :bin{ 311a32 }, :intvector{ 0, 1, 3 }, :int{0}, :int{0}, "", "", "\U00010401" }
1044 // simple sample, no error handling
1045 { "UTF-8", "a\U0010FFFF", :bin{ 61F48FBFBF }, :intvector{ 0, 1, 1, 1, 1 }, :int{1}, :int{0}, "", "", "" }
1050 // charset - will be opened, and ucnv_getUnicodeSet() called on it
1051 // map - set of code points and strings that must be in the returned set
1052 // mapnot - set of code points and strings that must *not* be in the returned set
1053 // which - numeric UConverterUnicodeSet value
1054 Headers { "charset", "map", "mapnot", "which" }
1056 // Unicode charsets that do not map surrogate code points
1059 "[\x00-\ud7ff\ue000-\U0010ffff]",
1065 "[\x00-\ud7ff\ue000-\U0010ffff]",
1071 "[\x00-\ud7ff\ue000-\U0010ffff]",
1077 "[\x00-\ud7ff\ue000-\U0010ffff]",
1083 "[\x00-\ud7ff\ue000-\U0010ffff]",
1089 "[\x00-\ud7ff\ue000-\U0010ffff]",
1095 "[\x00-\ud7ff\ue000-\U0010ffff]",
1100 // Unicode charsets that do map surrogate code points
1103 "[\x00-\U0010ffff]",
1109 "[\x00-\U0010ffff]",
1115 "[\x00-\U0010ffff]",
1121 "[\x00-\U0010ffff]",
1126 // versions of ISO-2022-KR
1129 "[\x00-\x0d\x10-\x1a\x1c-\x7f\xa1\xa4\xfe\u0111\u4e00\u4e01\uac00-\uac02\uffe6]",
1130 "[\x0e\x0f\x1b\x80-\xa0\xa3\xa5\xff-\u0110\uac03\uffe7-\U0010ffff]",
1135 "[\x00-\x0d\x10-\x1a\x1c-\x7f\xa1\xa4\xfe\u0111\u4e00\u4e01\uac00-\uac01\uffe6]",
1136 "[\x0e\x0f\x1b\x80-\xa0\xa3\xa5\xff-\u0110\uac02\uffe7-\U0010ffff]",
1140 // versions of ISO-2022-JP
1143 "[\x00-\x0d\x10-\x1a\x1c-\x7f\u0391-\u03a1\uff61-\uff9f\u4e00\u4e01\uffe5]",
1144 "[\x0e\x0f\x1b\u0100-\u0113\u0385-\u038a\u4e02\u4e27-\u4e29\uffe6-\U0010ffff]",
1149 "[\x00-\x0d\x10-\x1a\x1c-\u0113\u0385-\u038a\u0390-\u03a1\uff61-\uff9f\u4e00-\u4e05\uffe6]",
1150 "[\x0e\x0f\x1b\uffe7-\U0010ffff]",
1154 // versions of ISO-2022-CN
1157 "[\x00-\x0d\x10-\x1a\x1c-\x7f\u4e00\u4e01\u9f98\ufe6b]",
1158 "[\x0e\x0f\x1b\u4e29\uffe6-\U0010ffff]",
1163 "[\x00-\x0d\x10-\x1a\x1c-\x7f\u4e00-\u4e05\u9f98\ufe6b\u4e28-\u4e2b\U00020000\U00020003-\U00020005\U00029664]",
1164 "[\x0e\x0f\x1b\U00020001\U00020002\U0002a6d7-\U0010ffff]",
1171 "[\xa1\xa4\uac01\ub000]",
1172 "[\x00-\x9f\u2015]",
1178 "[\xa0\xa1\xa4\xa6-\xab\xad-\u017f\u0254\u309b-\u30ff\u4e00-\u4e05\U00023d00\U000243bc\U0002a6b2"
1179 "{\u0254\u0300}{\u0254\u0301}{\u304b\u309a}{\u30ad\u309a}{\u30af\u309a}]",
1180 "[\x00-0x9f\xa2\xa3\xa5\xac\u0200-\u024f\U00010000-\U0001ffff\U0002a61b-\U0002a6b1]",
1187 "[\x00-\x0d\x10-\u017f\u0254\u309b-\u30ff\u4e00-\u4e05\U00023d00\U000243bc\U0002a6b2"
1188 "{\u0254\u0300}{\u0254\u0301}{\u304b\u309a}{\u30ad\u309a}{\u30af\u309a}]",
1189 "[\x0e\x0f\u0200-\u024f\U00010000-\U0001ffff\U0002a61b-\U0002a6b1]",
1195 "[\x05\x0b\xc0\u20ac\U00023456\U00101234"
1196 "{\U00101234\U00050005\U00060006}{\U00101234\U00050005}{\U00101234\U00060006}{\xc4\xc4\U00101234\x05}]",
1197 "[\x06\x0e\U00034567\U000febcd{\U00101234\U00070007}]",