diff options
Diffstat (limited to 'iconvdata/tst-table-to.c')
-rw-r--r-- | iconvdata/tst-table-to.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/iconvdata/tst-table-to.c b/iconvdata/tst-table-to.c index 4dec4acad1..2b75f0c6e8 100644 --- a/iconvdata/tst-table-to.c +++ b/iconvdata/tst-table-to.c @@ -32,6 +32,7 @@ main (int argc, char *argv[]) const char *charset; iconv_t cd; int bmp_only; + int no_tags; if (argc != 2) { @@ -47,16 +48,19 @@ main (int argc, char *argv[]) return 1; } - /* When testing UTF-8 or GB18030, stop at 0x10000, otherwise the output + /* When testing UTF-8, stop at 0x10000, otherwise the output file gets too big. */ - bmp_only = (strcmp (charset, "UTF-8") == 0 + bmp_only = (strcmp (charset, "UTF-8") == 0); + /* When testing any encoding other than UTF-8 or GB18030, stop at 0xE0000, + because the conversion drops Unicode tag characters (range + U+E0000..U+E007F). */ + no_tags = !(strcmp (charset, "UTF-8") == 0 || strcmp (charset, "GB18030") == 0); { unsigned int i; unsigned char buf[10]; - - for (i = 0; i < (bmp_only ? 0x10000 : 0x30000); i++) + for (i = 0; i < (bmp_only ? 0x10000 : no_tags ? 0xE0000 : 0x110000); i++) { unsigned char in[6]; unsigned int incount = |