summaryrefslogtreecommitdiff
path: root/ext/nkf/lib/kconv.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-28 06:26:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-28 06:26:34 +0000
commit1b9d66dfebb17ae1e7c3dc7b4ce729e6e3e9b3cd (patch)
treed832fba6d09d616766d31fb2048e1376069bbb92 /ext/nkf/lib/kconv.rb
parentccc05de1e5f755a22ccdcac7f506460488e56f99 (diff)
* ext/nkf/lib/kconv.rb (Kconv::RegexpEucjp): second byte is up to
0xfe. * ext/nkf/lib/kconv.rb (Kconv#kconv): should handle UTF8 and UTF16 properly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/nkf/lib/kconv.rb')
-rw-r--r--ext/nkf/lib/kconv.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/nkf/lib/kconv.rb b/ext/nkf/lib/kconv.rb
index 1fd28a5a593..df2f25c399d 100644
--- a/ext/nkf/lib/kconv.rb
+++ b/ext/nkf/lib/kconv.rb
@@ -74,8 +74,8 @@ module Kconv
RegexpEucjp = /\A(?:
[\x00-\x7f] |
\x8e [\xa1-\xdf] |
- \x8f [\xa1-\xdf] [\xa1-\xdf] |
- [\xa1-\xdf] [\xa1-\xdf]
+ \x8f [\xa1-\xdf] [\xa1-\xfe] |
+ [\xa1-\xdf] [\xa1-\xfe]
)*\z/nx
RegexpUtf8 = /\A(?:
[\x00-\x7f] |
@@ -101,8 +101,9 @@ module Kconv
when ::NKF::SJIS
opt << 'S'
when ::NKF::UTF8
- when ::NKF::UTF16
opt << 'W'
+ when ::NKF::UTF16
+ opt << 'W16'
end
case out_code
@@ -113,8 +114,9 @@ module Kconv
when ::NKF::SJIS
opt << 's'
when ::NKF::UTF8
- when ::NKF::UTF16
opt << 'w'
+ when ::NKF::UTF16
+ opt << 'w16'
when ::NKF::NOCONV
return str
end