From a2aa7df3d6bf73cda977ee050a503a7f7a78a82d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 25 Sep 2000 21:37:47 +0000 Subject: Update. * charmaps/GBK: Add commented mappings for GBK characters not yet in Unicode. 2000-09-23 Bruno Haible --- iconvdata/gbgbk.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'iconvdata/gbgbk.c') diff --git a/iconvdata/gbgbk.c b/iconvdata/gbgbk.c index 02e25f3..b433ae2 100644 --- a/iconvdata/gbgbk.c +++ b/iconvdata/gbgbk.c @@ -65,9 +65,11 @@ All these characters are not defined in GB2312. Besides this \ there is an incomatibility in the mapping. The Unicode tables \ say that 0xA1A4 maps in GB2312 to U30FB while in GBK it maps to \ - U00B7. Since we are free to do whatever we want if a mapping \ - is not available we will not flag this as an error but instead \ - map the two positions. But this means that the mapping \ + U00B7. Similarly, 0xA1AA maps in GB2312 to U2015 while in GBK \ + it maps to U2014. Since we are free to do whatever we want if \ + a mapping is not available we will not flag this as an error \ + but instead map the two positions. But this means that the \ + mapping \ \ UCS4 -> GB2312 -> GBK -> UCS4 \ \ @@ -89,6 +91,10 @@ \ ch = (ch << 8) | inptr[1]; \ \ + /* Map 0xA844 (U2015 in GBK) to 0xA1AA (U2015 in GB2312). */ \ + if (__builtin_expect (ch == 0xa844, 0)) \ + ch = 0xa1aa; \ + \ /* Now determine whether the character is valid. */ \ if (__builtin_expect (ch, 0xa1a1) < 0xa1a1 \ || __builtin_expect (ch, 0xa1a1) > 0xf7fe \ @@ -123,8 +129,8 @@ #define BODY \ { \ /* We don't have to care about characters we cannot map. The only \ - problem is the mapping of 0xA1A4 but as explained above we do not \ - do anything special here. */ \ + problem are the mapping of 0xA1A4 and 0xA1AA but as explained above \ + we do not do anything special here. */ \ unsigned char ch = *inptr++; \ \ if (ch > 0x7f) \ -- cgit v1.1