about summary refs log tree commit diff
path: root/iconvdata/gbgbk.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-09-25 21:37:47 +0000
committerUlrich Drepper <drepper@redhat.com>2000-09-25 21:37:47 +0000
commita2aa7df3d6bf73cda977ee050a503a7f7a78a82d (patch)
treeafa23ee404ae7a1e3a73d7b5dcaa62e8fe83fc23 /iconvdata/gbgbk.c
parentfbb1f75f1eda28971ab9bc9bf3c58d6718841c80 (diff)
downloadglibc-a2aa7df3d6bf73cda977ee050a503a7f7a78a82d.tar.gz
glibc-a2aa7df3d6bf73cda977ee050a503a7f7a78a82d.tar.xz
glibc-a2aa7df3d6bf73cda977ee050a503a7f7a78a82d.zip
Update.
	* charmaps/GBK: Add commented mappings for GBK characters not yet in
	Unicode.

2000-09-23  Bruno Haible  <haible@clisp.cons.org>
Diffstat (limited to 'iconvdata/gbgbk.c')
-rw-r--r--iconvdata/gbgbk.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/iconvdata/gbgbk.c b/iconvdata/gbgbk.c
index 02e25f31e3..b433ae2cb0 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)							      \