summaryrefslogtreecommitdiffstats
path: root/lib/rexml/encodings
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-17 05:23:54 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-17 05:23:54 +0000
commita61ea1af99fafbf063b0c5b2784f4d07574eb8ed (patch)
tree034d9e3ed468898636d9e4fd68e14d083745cccc /lib/rexml/encodings
parentaaa2313a13e20fca69fbc2a7949185d08fd37242 (diff)
downloadruby-a61ea1af99fafbf063b0c5b2784f4d07574eb8ed.tar.gz
ruby-a61ea1af99fafbf063b0c5b2784f4d07574eb8ed.tar.xz
ruby-a61ea1af99fafbf063b0c5b2784f4d07574eb8ed.zip
* eval.c (ruby_init): set ruby_running to true after
initialization. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/encodings')
-rw-r--r--lib/rexml/encodings/EUC-JP.rb4
-rw-r--r--lib/rexml/encodings/SHIFT_JIS.rb18
2 files changed, 19 insertions, 3 deletions
diff --git a/lib/rexml/encodings/EUC-JP.rb b/lib/rexml/encodings/EUC-JP.rb
index 1be5663be..def760b30 100644
--- a/lib/rexml/encodings/EUC-JP.rb
+++ b/lib/rexml/encodings/EUC-JP.rb
@@ -18,11 +18,11 @@ rescue LoadError
module REXML
module Encoding
def from_euc_jp(str)
- return Iconv::iconv("utf-8", "euc-jp", str).join
+ return Iconv::iconv("utf-8", "euc-jp", str).join('')
end
def to_euc_jp content
- return Iconv::iconv("euc-jp", "utf-8", content).join
+ return Iconv::iconv("euc-jp", "utf-8", content).join('')
end
end
end
diff --git a/lib/rexml/encodings/SHIFT_JIS.rb b/lib/rexml/encodings/SHIFT_JIS.rb
index 865017453..27e456940 100644
--- a/lib/rexml/encodings/SHIFT_JIS.rb
+++ b/lib/rexml/encodings/SHIFT_JIS.rb
@@ -13,5 +13,21 @@ begin
end
end
rescue LoadError
- raise "uconv is required for Japanese encoding support."
+ 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