Merged in the changes from BSD bug report. shift-jis is now shift_jis, in
accordance with IANA git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4497af1591
commit
96439f2a4a
@ -5,11 +5,11 @@ begin
|
|||||||
module Encoding
|
module Encoding
|
||||||
@@__REXML_encoding_methods =<<-EOL
|
@@__REXML_encoding_methods =<<-EOL
|
||||||
def decode(str)
|
def decode(str)
|
||||||
return Iconv::iconv("utf-8", "shift-jis", str)[0]
|
return Iconv::iconv("utf-8", "shift_jis", str)[0]
|
||||||
end
|
end
|
||||||
|
|
||||||
def encode content
|
def encode content
|
||||||
return Iconv::iconv("shift-jis", "utf-8", content)[0]
|
return Iconv::iconv("shift_jis", "utf-8", content)[0]
|
||||||
end
|
end
|
||||||
EOL
|
EOL
|
||||||
end
|
end
|
||||||
@ -21,11 +21,11 @@ rescue LoadError
|
|||||||
module REXML
|
module REXML
|
||||||
module Encoding
|
module Encoding
|
||||||
@@__REXML_encoding_methods =<<-EOL
|
@@__REXML_encoding_methods =<<-EOL
|
||||||
def to_shift_jis content
|
def encode(content)
|
||||||
Uconv::u8tosjis(content)
|
Uconv::u8tosjis(content)
|
||||||
end
|
end
|
||||||
|
|
||||||
def from_shift_jis(str)
|
def decode(str)
|
||||||
Uconv::sjistou8(str)
|
Uconv::sjistou8(str)
|
||||||
end
|
end
|
||||||
EOL
|
EOL
|
||||||
|
@ -1 +1 @@
|
|||||||
require 'rexml/encodings/Shift-JIS'
|
load 'rexml/encodings/Shift-JIS'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user