summaryrefslogtreecommitdiff
path: root/lib/rexml
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-11 05:26:30 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-11 05:26:30 +0000
commit0f33529f639d112dff43137c0d9c618a583d4244 (patch)
tree2b07065f7b1d4436fba88894f9b022fd75e9763b /lib/rexml
parent28595a72a9d0f90d75d9d64ae1203c80e576a895 (diff)
* rename 'Shift-JIS' to 'SHIFT-JIS'
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml')
-rw-r--r--lib/rexml/encodings/SHIFT-JIS.rb1
-rw-r--r--lib/rexml/encodings/SHIFT_JIS.rb17
-rw-r--r--lib/rexml/encodings/Shift-JIS.rb32
-rw-r--r--lib/rexml/encodings/Shift_JIS.rb1
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 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'