summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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'