diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-10-16 18:06:31 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-10-16 18:06:31 +0000 |
commit | dd2d65fa6f9f42e4303757de46d2dd3e7fa0247a (patch) | |
tree | 4fa831c2ca1bffb934939bc3800ee278c5ab646c /enc | |
parent | b19494fd6ad74da9871b6d4339c3b6e612d980a7 (diff) | |
download | ruby-dd2d65fa6f9f42e4303757de46d2dd3e7fa0247a.tar.gz ruby-dd2d65fa6f9f42e4303757de46d2dd3e7fa0247a.tar.xz ruby-dd2d65fa6f9f42e4303757de46d2dd3e7fa0247a.zip |
* enc/utf8.c (utf8_code_to_mbclen): 0xfe and 0xff are valid Unicode to
be encoded to 2bytes in UTF-8. [ruby-core:12700]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc')
-rw-r--r-- | enc/utf8.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/enc/utf8.c b/enc/utf8.c index 3add59f47..a2acd5eee 100644 --- a/enc/utf8.c +++ b/enc/utf8.c @@ -121,11 +121,7 @@ static int utf8_code_to_mbclen(OnigCodePoint code, OnigEncoding enc) { if ((code & 0xffffff80) == 0) return 1; - else if ((code & 0xfffff800) == 0) { - if (code <= 0xff && code >= 0xfe) - return 1; - return 2; - } + else if ((code & 0xfffff800) == 0) return 2; else if ((code & 0xffff0000) == 0) return 3; else if ((code & 0xffe00000) == 0) return 4; else if ((code & 0xfc000000) == 0) return 5; |