summaryrefslogtreecommitdiffstats
path: root/ext/nkf/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-10-29 09:25:48 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-10-29 09:25:48 +0000
commit9868574ae43c0fdc49a9d3fc0431bb0613507bfa (patch)
tree4a0007dc6a1e7e8ae71ad40000b9ba56332dbaf2 /ext/nkf/lib
parent419abc80a3b260936a5c1b92690a4885774b29c6 (diff)
downloadruby-9868574ae43c0fdc49a9d3fc0431bb0613507bfa.tar.gz
ruby-9868574ae43c0fdc49a9d3fc0431bb0613507bfa.tar.xz
ruby-9868574ae43c0fdc49a9d3fc0431bb0613507bfa.zip
19991029
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/nkf/lib')
-rw-r--r--ext/nkf/lib/kconv.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/nkf/lib/kconv.rb b/ext/nkf/lib/kconv.rb
index bfd276330..af6d82275 100644
--- a/ext/nkf/lib/kconv.rb
+++ b/ext/nkf/lib/kconv.rb
@@ -56,3 +56,18 @@ module Kconv
end
module_function :guess
end
+
+class String
+ def kconv(out_code, in_code=Kconv::AUTO)
+ Kconv::kconv(self, out_code, in_code)
+ end
+ def tojis
+ NKF::nkf('-j', self)
+ end
+ def toeuc
+ NKF::nkf('-e', self)
+ end
+ def tosjis
+ NKF::nkf('-s', self)
+ end
+end