diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-17 05:23:54 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-17 05:23:54 +0000 |
commit | 46bf6217378e0dca4ff56446cf7233023f21778a (patch) | |
tree | 034d9e3ed468898636d9e4fd68e14d083745cccc /lib/rexml | |
parent | 06f82d38838e3d588c96e12bf492b685ff1d8322 (diff) |
* eval.c (ruby_init): set ruby_running to true after
initialization.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml')
-rw-r--r-- | lib/rexml/encodings/EUC-JP.rb | 4 | ||||
-rw-r--r-- | lib/rexml/encodings/SHIFT_JIS.rb | 18 |
2 files changed, 19 insertions, 3 deletions
diff --git a/lib/rexml/encodings/EUC-JP.rb b/lib/rexml/encodings/EUC-JP.rb index 1be5663be8..def760b303 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 8650174538..27e4569403 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 |