summaryrefslogtreecommitdiff
path: root/ext/nkf/lib
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-03-27 13:28:15 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-03-27 13:28:15 +0000
commitbb1e80fd4efe138b0083e6aea7b26a23bddda2f7 (patch)
tree8e26253276b8c2a0d4f260fef00c2e2a470addb8 /ext/nkf/lib
parent15c3ddd0ff4a866fc4850b67eb673bedf6611c1d (diff)
* ext/nkf/nkf-utf8/{nkf.c, utf8tbl.c, config.h}: imported nkf 2.0.6.
* Add --ic / --oc option and mapping tables. * Add fallback option. * Add --no-best-fit-chars option. * Fix some bugs. * ext/nkf/nkf.c (nkf_split_options): added for parse option string. * ext/nkf/lib/kconv.rb (Kconv.to*): add -m0. Note that Kconv.to* still imply -X. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/nkf/lib')
-rw-r--r--ext/nkf/lib/kconv.rb43
1 files changed, 16 insertions, 27 deletions
diff --git a/ext/nkf/lib/kconv.rb b/ext/nkf/lib/kconv.rb
index 0cf7da1200..deaa4a02f6 100644
--- a/ext/nkf/lib/kconv.rb
+++ b/ext/nkf/lib/kconv.rb
@@ -130,11 +130,10 @@ module Kconv
# Convert <code>str</code> to ISO-2022-JP
#
# *Note*
- # This method decode MIME encoded string and
- # convert halfwidth katakana to fullwidth katakana.
+ # This method convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-jxm0', str).
def tojis(str)
- ::NKF::nkf('-j', str)
+ ::NKF::nkf('-jm0', str)
end
module_function :tojis
@@ -144,11 +143,10 @@ module Kconv
# Convert <code>str</code> to EUC-JP
#
# *Note*
- # This method decode MIME encoded string and
- # convert halfwidth katakana to fullwidth katakana.
+ # This method convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-exm0', str).
def toeuc(str)
- ::NKF::nkf('-e', str)
+ ::NKF::nkf('-em0', str)
end
module_function :toeuc
@@ -158,11 +156,10 @@ module Kconv
# Convert <code>str</code> to Shift_JIS
#
# *Note*
- # This method decode MIME encoded string and
- # convert halfwidth katakana to fullwidth katakana.
+ # This method convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-sxm0', str).
def tosjis(str)
- ::NKF::nkf('-s', str)
+ ::NKF::nkf('-sm0', str)
end
module_function :tosjis
@@ -172,11 +169,10 @@ module Kconv
# Convert <code>str</code> to UTF-8
#
# *Note*
- # This method decode MIME encoded string and
- # convert halfwidth katakana to fullwidth katakana.
+ # This method convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-wxm0', str).
def toutf8(str)
- ::NKF::nkf('-w', str)
+ ::NKF::nkf('-wm0', str)
end
module_function :toutf8
@@ -186,11 +182,10 @@ module Kconv
# Convert <code>str</code> to UTF-16
#
# *Note*
- # This method decode MIME encoded string and
- # convert halfwidth katakana to fullwidth katakana.
+ # This method convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-w16xm0', str).
def toutf16(str)
- ::NKF::nkf('-w16', str)
+ ::NKF::nkf('-w16m0', str)
end
module_function :toutf16
@@ -263,8 +258,7 @@ class String
# <code>out_code</code> and <code>in_code</code> are given as constants of Kconv.
#
# *Note*
- # This method decode MIME encoded string and
- # convert halfwidth katakana to fullwidth katakana.
+ # This method 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)
@@ -280,8 +274,7 @@ class String
# Convert <code>self</code> to ISO-2022-JP
#
# *Note*
- # This method decode MIME encoded string and
- # convert halfwidth katakana to fullwidth katakana.
+ # This method convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-jxm0', str).
def tojis; Kconv.tojis(self) end
@@ -291,8 +284,7 @@ class String
# Convert <code>self</code> to EUC-JP
#
# *Note*
- # This method decode MIME encoded string and
- # convert halfwidth katakana to fullwidth katakana.
+ # This method convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-exm0', str).
def toeuc; Kconv.toeuc(self) end
@@ -302,8 +294,7 @@ class String
# Convert <code>self</code> to Shift_JIS
#
# *Note*
- # This method decode MIME encoded string and
- # convert halfwidth katakana to fullwidth katakana.
+ # This method convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-sxm0', str).
def tosjis; Kconv.tosjis(self) end
@@ -313,8 +304,7 @@ class String
# Convert <code>self</code> to UTF-8
#
# *Note*
- # This method decode MIME encoded string and
- # convert halfwidth katakana to fullwidth katakana.
+ # This method convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-wxm0', str).
def toutf8; Kconv.toutf8(self) end
@@ -324,8 +314,7 @@ class String
# Convert <code>self</code> to UTF-16
#
# *Note*
- # This method decode MIME encoded string and
- # convert halfwidth katakana to fullwidth katakana.
+ # This method convert halfwidth katakana to fullwidth katakana.
# If you don't want it, use NKF.nkf('-w16xm0', str).
def toutf16; Kconv.toutf16(self) end