summaryrefslogtreecommitdiff
path: root/ext/nkf/lib/kconv.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-04 09:06:41 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-04 09:06:41 +0000
commit01b097e475a4cba774d2ba14db9b9d275b9561bb (patch)
tree453e80a5d802e1d48226e159fff60f16094ed4c3 /ext/nkf/lib/kconv.rb
parent825ce503c0e52edb944def195be0d3d55e3e71b3 (diff)
* ext/nkf/lib/kconv.rb (tojis, tosjis, toeuc, toutf8):
set encoding. [ruby-dev:32447] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/nkf/lib/kconv.rb')
-rw-r--r--ext/nkf/lib/kconv.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/nkf/lib/kconv.rb b/ext/nkf/lib/kconv.rb
index 91553228fee..f3c84d65176 100644
--- a/ext/nkf/lib/kconv.rb
+++ b/ext/nkf/lib/kconv.rb
@@ -146,7 +146,7 @@ module Kconv
# convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-jxm0', str).
def tojis(str)
- ::NKF::nkf('-jm', str)
+ ::NKF::nkf('-jm', str).force_encoding("iso-2022-JP")
end
module_function :tojis
@@ -160,7 +160,7 @@ module Kconv
# convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-exm0', str).
def toeuc(str)
- ::NKF::nkf('-em', str)
+ ::NKF::nkf('-em', str).force_encoding("EUC-JP")
end
module_function :toeuc
@@ -174,7 +174,7 @@ module Kconv
# convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-sxm0', str).
def tosjis(str)
- ::NKF::nkf('-sm', str)
+ ::NKF::nkf('-sm', str).force_encoding("Shift_JIS")
end
module_function :tosjis
@@ -188,7 +188,7 @@ module Kconv
# convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-wxm0', str).
def toutf8(str)
- ::NKF::nkf('-wm', str)
+ ::NKF::nkf('-wm', str).force_encoding("UTF-8")
end
module_function :toutf8