diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-11 05:26:30 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-11 05:26:30 +0000 |
commit | a385b512a4870784b2b8467cc3061553c58ae436 (patch) | |
tree | 2b07065f7b1d4436fba88894f9b022fd75e9763b /lib | |
parent | 7fc0ffc7ac65d7c49db15dca0d420abb8c59cb27 (diff) | |
download | ruby-a385b512a4870784b2b8467cc3061553c58ae436.tar.gz ruby-a385b512a4870784b2b8467cc3061553c58ae436.tar.xz ruby-a385b512a4870784b2b8467cc3061553c58ae436.zip |
* rename 'Shift-JIS' to 'SHIFT-JIS'
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rexml/encodings/SHIFT-JIS.rb | 1 | ||||
-rw-r--r-- | lib/rexml/encodings/SHIFT_JIS.rb | 17 | ||||
-rw-r--r-- | lib/rexml/encodings/Shift-JIS.rb | 32 | ||||
-rw-r--r-- | lib/rexml/encodings/Shift_JIS.rb | 1 |
4 files changed, 18 insertions, 33 deletions
diff --git a/lib/rexml/encodings/SHIFT-JIS.rb b/lib/rexml/encodings/SHIFT-JIS.rb new file mode 100644 index 000000000..2c2a6890c --- /dev/null +++ b/lib/rexml/encodings/SHIFT-JIS.rb @@ -0,0 +1 @@ +require 'rexml/encodings/SHIFT_JIS' diff --git a/lib/rexml/encodings/SHIFT_JIS.rb b/lib/rexml/encodings/SHIFT_JIS.rb new file mode 100644 index 000000000..865017453 --- /dev/null +++ b/lib/rexml/encodings/SHIFT_JIS.rb @@ -0,0 +1,17 @@ +begin + require 'uconv' + + module REXML + module Encoding + def to_shift_jis content + Uconv::u8tosjis(content) + end + + def from_shift_jis(str) + Uconv::sjistou8(str) + end + end + end +rescue LoadError + raise "uconv is required for Japanese encoding support." +end diff --git a/lib/rexml/encodings/Shift-JIS.rb b/lib/rexml/encodings/Shift-JIS.rb deleted file mode 100644 index d5267c01b..000000000 --- a/lib/rexml/encodings/Shift-JIS.rb +++ /dev/null @@ -1,32 +0,0 @@ -begin - require 'uconv' - - module REXML - module Encoding - def from_shift_jis(str) - Uconv::u8tosjis(content) - end - - def to_shift_jis content - Uconv::sjistou8(str) - end - end - end -rescue LoadError - begin - require 'iconv' - module REXML - module Encoding - def from_shift_jis(str) - return Iconv::iconv("utf-8", "shift-jis", str).join - end - - def to_shift_jis content - return Iconv::iconv("shift-jis", "utf-8", content).join - end - end - end - rescue LoadError - raise "uconv or iconv is required for Japanese encoding support." - end -end diff --git a/lib/rexml/encodings/Shift_JIS.rb b/lib/rexml/encodings/Shift_JIS.rb deleted file mode 100644 index 6e8f75937..000000000 --- a/lib/rexml/encodings/Shift_JIS.rb +++ /dev/null @@ -1 +0,0 @@ -require 'rexml/encodings/Shift-JIS' |