summaryrefslogtreecommitdiff
path: root/ext/nkf/lib/kconv.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-19 14:40:23 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-19 14:40:23 +0000
commita59c6fe7c953e2f427cf3f622cd94e1634828a43 (patch)
treed069b1eadfd6bd482efaa83fd84a6aba8da6e641 /ext/nkf/lib/kconv.rb
parent5c691de4421e7a5c397781a61e1826bc46a892eb (diff)
* kconv.rb: remove default -m0 and fix document.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/nkf/lib/kconv.rb')
-rw-r--r--ext/nkf/lib/kconv.rb51
1 files changed, 35 insertions, 16 deletions
diff --git a/ext/nkf/lib/kconv.rb b/ext/nkf/lib/kconv.rb
index deaa4a02f60..091b88b1c0c 100644
--- a/ext/nkf/lib/kconv.rb
+++ b/ext/nkf/lib/kconv.rb
@@ -3,9 +3,17 @@
#
# $Id$
#
+# ----
+#
+# kconv.rb implements the Kconv class for Kanji Converter. Additionally,
+# some methods in String classes are added to allow easy conversion.
+#
require 'nkf'
+#
+# Kanji Converter for Ruby.
+#
module Kconv
#
# Public Constants
@@ -35,7 +43,7 @@ module Kconv
UTF32 = NKF::UTF32
# UNKNOWN
UNKNOWN = NKF::UNKNOWN
-
+
#
# Private Constants
#
@@ -130,10 +138,11 @@ module Kconv
# Convert <code>str</code> to ISO-2022-JP
#
# *Note*
- # This method convert halfwidth katakana to fullwidth katakana.
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-jxm0', str).
def tojis(str)
- ::NKF::nkf('-jm0', str)
+ ::NKF::nkf('-jm', str)
end
module_function :tojis
@@ -143,7 +152,8 @@ module Kconv
# Convert <code>str</code> to EUC-JP
#
# *Note*
- # This method convert halfwidth katakana to fullwidth katakana.
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-exm0', str).
def toeuc(str)
::NKF::nkf('-em0', str)
@@ -156,10 +166,11 @@ module Kconv
# Convert <code>str</code> to Shift_JIS
#
# *Note*
- # This method convert halfwidth katakana to fullwidth katakana.
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-sxm0', str).
def tosjis(str)
- ::NKF::nkf('-sm0', str)
+ ::NKF::nkf('-sm', str)
end
module_function :tosjis
@@ -169,10 +180,11 @@ module Kconv
# Convert <code>str</code> to UTF-8
#
# *Note*
- # This method convert halfwidth katakana to fullwidth katakana.
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-wxm0', str).
def toutf8(str)
- ::NKF::nkf('-wm0', str)
+ ::NKF::nkf('-wm', str)
end
module_function :toutf8
@@ -182,10 +194,11 @@ module Kconv
# Convert <code>str</code> to UTF-16
#
# *Note*
- # This method convert halfwidth katakana to fullwidth katakana.
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-w16xm0', str).
def toutf16(str)
- ::NKF::nkf('-w16m0', str)
+ ::NKF::nkf('-w16m', str)
end
module_function :toutf16
@@ -258,7 +271,8 @@ class String
# <code>out_code</code> and <code>in_code</code> are given as constants of Kconv.
#
# *Note*
- # This method convert halfwidth katakana to fullwidth katakana.
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
# If you don't want to decode them, use NKF.nkf.
def kconv(out_code, in_code=Kconv::AUTO)
Kconv::kconv(self, out_code, in_code)
@@ -274,7 +288,8 @@ class String
# Convert <code>self</code> to ISO-2022-JP
#
# *Note*
- # This method convert halfwidth katakana to fullwidth katakana.
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-jxm0', str).
def tojis; Kconv.tojis(self) end
@@ -284,7 +299,8 @@ class String
# Convert <code>self</code> to EUC-JP
#
# *Note*
- # This method convert halfwidth katakana to fullwidth katakana.
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-exm0', str).
def toeuc; Kconv.toeuc(self) end
@@ -294,7 +310,8 @@ class String
# Convert <code>self</code> to Shift_JIS
#
# *Note*
- # This method convert halfwidth katakana to fullwidth katakana.
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-sxm0', str).
def tosjis; Kconv.tosjis(self) end
@@ -304,7 +321,8 @@ class String
# Convert <code>self</code> to UTF-8
#
# *Note*
- # This method convert halfwidth katakana to fullwidth katakana.
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-wxm0', str).
def toutf8; Kconv.toutf8(self) end
@@ -314,7 +332,8 @@ class String
# Convert <code>self</code> to UTF-16
#
# *Note*
- # This method convert halfwidth katakana to fullwidth katakana.
+ # This method decode MIME encoded string and
+ # convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-w16xm0', str).
def toutf16; Kconv.toutf16(self) end