summaryrefslogtreecommitdiff
path: root/enc
diff options
context:
space:
mode:
Diffstat (limited to 'enc')
-rw-r--r--enc/gb18030.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/enc/gb18030.c b/enc/gb18030.c
index f62a2394c9..d58abf8792 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);
}