aboutsummaryrefslogtreecommitdiff
path: root/iconvdata/tst-table-to.c
diff options
context:
space:
mode:
authorlijianglin <lijianglin2@huawei.com>2023-06-27 20:15:49 +0800
committerMike FABIAN <mfabian@redhat.com>2023-08-29 19:02:30 +0200
commite1d3312015e8f70344620375aedf91afe7e7e7a4 (patch)
tree7cb4bdd67996531918511dc3e230f7fecc23ec3a /iconvdata/tst-table-to.c
parentd3c34a2dd982a77abf631ea2f88f4efab1b064c4 (diff)
downloadglibc-e1d3312015e8f70344620375aedf91afe7e7e7a4.zip
glibc-e1d3312015e8f70344620375aedf91afe7e7e7a4.tar.gz
glibc-e1d3312015e8f70344620375aedf91afe7e7e7a4.tar.bz2
add GB18030-2022 charmap and test the entire GB18030 charmap [BZ #30243]
support GB18030-2022 after add and change some transcoding relationship of GB18030-2022.Details are as follows: add 25 transcoding relationship UE81E 0x82359037 UE826 0x82359038 UE82B 0x82359039 UE82C 0x82359130 UE832 0x82359131 UE843 0x82359132 UE854 0x82359133 UE864 0x82359134 UE78D 0x84318236 UE78F 0x84318237 UE78E 0x84318238 UE790 0x84318239 UE791 0x84318330 UE792 0x84318331 UE793 0x84318332 UE794 0x84318333 UE795 0x84318334 UE796 0x84318335 UE816 0xfe51 UE817 0xfe52 UE818 0xfe53 UE831 0xfe6c UE83B 0xfe76 UE855 0xfe91 change 6 transcoding relationship U20087 0x95329031 U20089 0x95329033 U200CC 0x95329730 U215D7 0x9536b937 U2298F 0x9630ba35 U241FE 0x9635b630 Test the entire GB18030 charmap, not only the Unicode BMP part. Co-authored-by: yangyanchao <yangyanchao6@huawei.com> Co-authored-by: liqingqing <liqingqing3@huawei.com> Co-authored-by: Bruno Haible <bruno@clisp.org> Reviewed-by: Andreas Schwab <schwab@suse.de> Reviewed-by: Mike FABIAN <mfabian@redhat.com>
Diffstat (limited to 'iconvdata/tst-table-to.c')
-rw-r--r--iconvdata/tst-table-to.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/iconvdata/tst-table-to.c b/iconvdata/tst-table-to.c
index 4dec4ac..2b75f0c 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 =