From a385b512a4870784b2b8467cc3061553c58ae436 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 11 Jul 2003 05:26:30 +0000 Subject: * rename 'Shift-JIS' to 'SHIFT-JIS' git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rexml/encodings/SHIFT-JIS.rb | 1 + lib/rexml/encodings/SHIFT_JIS.rb | 17 +++++++++++++++++ lib/rexml/encodings/Shift-JIS.rb | 32 -------------------------------- lib/rexml/encodings/Shift_JIS.rb | 1 - 4 files changed, 18 insertions(+), 33 deletions(-) create mode 100644 lib/rexml/encodings/SHIFT-JIS.rb create mode 100644 lib/rexml/encodings/SHIFT_JIS.rb delete mode 100644 lib/rexml/encodings/Shift-JIS.rb delete mode 100644 lib/rexml/encodings/Shift_JIS.rb (limited to 'lib/rexml') 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' -- cgit