diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-31 10:14:38 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-31 10:14:38 +0000 |
commit | 0682fab6a2ad52f51a440336e99a9abe28e7c050 () | |
tree | eb4a076875f13a6f651362c36661f973c3162e61 /enc/utf_16le.c | |
parent | 075530a6850ebf899e8874d7675fd900577c9554 (diff) |
* enc/utf_16{be,le}.c (utf16{be,le}_code_to_mbc):
fix codepoint to bytes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | enc/utf_16le.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -126,15 +126,12 @@ utf16le_code_to_mbc(OnigCodePoint code, UChar *buf, UChar* p = buf; if (code > 0xffff) { - unsigned int plane, high; - - plane = code >> 16; - high = (code & 0xff00) >> 8; - - *p++ = ((plane & 0x03) << 6) + (high >> 2); - *p++ = (plane >> 2) + 0xd8; - *p++ = (UChar )(code & 0xff); - *p = (high & 0x02) + 0xdc; return 4; } else { |