diff options
Diffstat (limited to 'enc')
-rw-r--r-- | enc/emacs_mule.c | 3 | ||||
-rw-r--r-- | enc/gb18030.c | 4 |
2 files changed, 1 insertions, 6 deletions
diff --git a/enc/emacs_mule.c b/enc/emacs_mule.c index 9ebb44339a..e97bb6aedd 100644 --- a/enc/emacs_mule.c +++ b/enc/emacs_mule.c @@ -237,7 +237,6 @@ mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc) c = *p++; n <<= 8; n += c; } - n &= 0x7FFFFFFF; return n; } @@ -258,7 +257,7 @@ code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc) { UChar *p = buf; - if ((code & 0xff000000) != 0) *p++ = (UChar )(((code >> 24) | 0x80)); + if ((code & 0xff000000) != 0) *p++ = (UChar )(((code >> 24) & 0xff)); if ((code & 0xff0000) != 0) *p++ = (UChar )(((code >> 16) & 0xff)); if ((code & 0xff00) != 0) *p++ = (UChar )(((code >> 8) & 0xff)); *p++ = (UChar )(code & 0xff); diff --git a/enc/gb18030.c b/enc/gb18030.c index 804f3cdc00..2b707d4a7d 100644 --- a/enc/gb18030.c +++ b/enc/gb18030.c @@ -178,16 +178,12 @@ gb18030_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc) c = *p++; n <<= 8; n += c; } - n &= 0x7FFFFFFF; return n; } 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); } |