From 0f33529f639d112dff43137c0d9c618a583d4244 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 11 Jul 2003 05:26:30 +0000 Subject: [PATCH] * rename 'Shift-JIS' to 'SHIFT-JIS' git-svn-id: svn+ssh://ci.ruby-lang.org/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 diff --git a/lib/rexml/encodings/SHIFT-JIS.rb b/lib/rexml/encodings/SHIFT-JIS.rb new file mode 100644 index 0000000000..2c2a6890c8 --- /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 0000000000..8650174538 --- /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 d5267c01b2..0000000000 --- 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 6e8f759373..0000000000 --- a/lib/rexml/encodings/Shift_JIS.rb +++ /dev/null @@ -1 +0,0 @@ -require 'rexml/encodings/Shift-JIS'