* 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
This commit is contained in:
parent
825ce503c0
commit
01b097e475
@ -1,3 +1,8 @@
|
|||||||
|
Tue Dec 4 17:34:17 2007 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/nkf/lib/kconv.rb (tojis, tosjis, toeuc, toutf8):
|
||||||
|
set encoding. [ruby-dev:32447]
|
||||||
|
|
||||||
Tue Dec 4 17:07:25 2007 NARUSE, Yui <naruse@ruby-lang.org>
|
Tue Dec 4 17:07:25 2007 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* lib/json.rb, lib/json/*: moved to ext/json/lib.
|
* lib/json.rb, lib/json/*: moved to ext/json/lib.
|
||||||
|
@ -146,7 +146,7 @@ module Kconv
|
|||||||
# convert halfwidth katakana to fullwidth katakana.
|
# convert halfwidth katakana to fullwidth katakana.
|
||||||
# If you don't want it, use NKF.nkf('-jxm0', str).
|
# If you don't want it, use NKF.nkf('-jxm0', str).
|
||||||
def tojis(str)
|
def tojis(str)
|
||||||
::NKF::nkf('-jm', str)
|
::NKF::nkf('-jm', str).force_encoding("iso-2022-JP")
|
||||||
end
|
end
|
||||||
module_function :tojis
|
module_function :tojis
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ module Kconv
|
|||||||
# convert halfwidth katakana to fullwidth katakana.
|
# convert halfwidth katakana to fullwidth katakana.
|
||||||
# If you don't want it, use NKF.nkf('-exm0', str).
|
# If you don't want it, use NKF.nkf('-exm0', str).
|
||||||
def toeuc(str)
|
def toeuc(str)
|
||||||
::NKF::nkf('-em', str)
|
::NKF::nkf('-em', str).force_encoding("EUC-JP")
|
||||||
end
|
end
|
||||||
module_function :toeuc
|
module_function :toeuc
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ module Kconv
|
|||||||
# convert halfwidth katakana to fullwidth katakana.
|
# convert halfwidth katakana to fullwidth katakana.
|
||||||
# If you don't want it, use NKF.nkf('-sxm0', str).
|
# If you don't want it, use NKF.nkf('-sxm0', str).
|
||||||
def tosjis(str)
|
def tosjis(str)
|
||||||
::NKF::nkf('-sm', str)
|
::NKF::nkf('-sm', str).force_encoding("Shift_JIS")
|
||||||
end
|
end
|
||||||
module_function :tosjis
|
module_function :tosjis
|
||||||
|
|
||||||
@ -188,7 +188,7 @@ module Kconv
|
|||||||
# convert halfwidth katakana to fullwidth katakana.
|
# convert halfwidth katakana to fullwidth katakana.
|
||||||
# If you don't want it, use NKF.nkf('-wxm0', str).
|
# If you don't want it, use NKF.nkf('-wxm0', str).
|
||||||
def toutf8(str)
|
def toutf8(str)
|
||||||
::NKF::nkf('-wm', str)
|
::NKF::nkf('-wm', str).force_encoding("UTF-8")
|
||||||
end
|
end
|
||||||
module_function :toutf8
|
module_function :toutf8
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user