1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* rename 'Shift-JIS' to 'SHIFT-JIS'

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-07-11 05:26:30 +00:00
parent 28595a72a9
commit 0f33529f63
4 changed files with 18 additions and 33 deletions

View file

@ -0,0 +1 @@
require 'rexml/encodings/SHIFT_JIS'

View file

@ -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

View file

@ -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

View file

@ -1 +0,0 @@
require 'rexml/encodings/Shift-JIS'