mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
* lib/rexml/encodings/SHIFT-JIS.rb: backported from CVS HEAD.
* lib/rexml/encodings/SHIFT_JIS.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0052b9172e
commit
8aeb8712f8
3 changed files with 11 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
|||
Mon Dec 20 00:28:20 2004 Kouhei Sutou <kou@cozmixng.org>
|
||||
|
||||
* lib/rexml/encodings/SHIFT-JIS.rb: backported from CVS HEAD.
|
||||
|
||||
* lib/rexml/encodings/SHIFT_JIS.rb: ditto.
|
||||
|
||||
Sun Dec 19 17:19:48 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
||||
|
||||
* ext/openssl/ossl_x509store.c
|
||||
|
|
|
@ -5,11 +5,11 @@ begin
|
|||
module Encoding
|
||||
@@__REXML_encoding_methods =<<-EOL
|
||||
def decode(str)
|
||||
return Iconv::iconv("utf-8", "shift-jis", str)[0]
|
||||
return Iconv::iconv("utf-8", "shift_jis", str)[0]
|
||||
end
|
||||
|
||||
def encode content
|
||||
return Iconv::iconv("shift-jis", "utf-8", content)[0]
|
||||
return Iconv::iconv("shift_jis", "utf-8", content)[0]
|
||||
end
|
||||
EOL
|
||||
end
|
||||
|
@ -21,11 +21,11 @@ rescue LoadError
|
|||
module REXML
|
||||
module Encoding
|
||||
@@__REXML_encoding_methods =<<-EOL
|
||||
def to_shift_jis content
|
||||
def encode(content)
|
||||
Uconv::u8tosjis(content)
|
||||
end
|
||||
|
||||
def from_shift_jis(str)
|
||||
def decode(str)
|
||||
Uconv::sjistou8(str)
|
||||
end
|
||||
EOL
|
||||
|
|
|
@ -1 +1 @@
|
|||
require 'rexml/encodings/Shift-JIS'
|
||||
load 'rexml/encodings/SHIFT-JIS.rb'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue