summaryrefslogtreecommitdiff
path: root/enc/gb18030.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-01 19:36:28 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-01 19:36:28 +0000
commit5397015d2e8c904dfbce3cc4a0884c9cbb47d8b2 (patch)
tree444b21cbb184496c2558faa68118f4e253e97a6e /enc/gb18030.c
parent8f05f7fe05154dada9988d704be3fac0229cbd62 (diff)
* enc/gb18030.c (gb18030_code_to_mbc): add 0x80000000
for 4bytes character. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc/gb18030.c')
-rw-r--r--enc/gb18030.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/enc/gb18030.c b/enc/gb18030.c
index f62a239..d58abf8 100644
--- a/enc/gb18030.c
+++ b/enc/gb18030.c
@@ -185,6 +185,9 @@ gb18030_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
static int
gb18030_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
{
+ if ((code & 0xff000000) != 0) {
+ code |= 0x80000000;
+ }
return onigenc_mb4_code_to_mbc(enc, code, buf);
}