diff options
Diffstat (limited to 'lang/ruby18/patches')
-rw-r--r-- | lang/ruby18/patches/patch-aj | 32 | ||||
-rw-r--r-- | lang/ruby18/patches/patch-ak | 39 |
2 files changed, 71 insertions, 0 deletions
diff --git a/lang/ruby18/patches/patch-aj b/lang/ruby18/patches/patch-aj new file mode 100644 index 00000000000..89b4b3329ca --- /dev/null +++ b/lang/ruby18/patches/patch-aj @@ -0,0 +1,32 @@ +$NetBSD: patch-aj,v 1.1 2004/12/05 17:25:53 taca Exp $ + +--- lib/rexml/encodings/SHIFT-JIS.rb.orig 2003-12-13 09:31:22.000000000 +0900 ++++ lib/rexml/encodings/SHIFT-JIS.rb +@@ -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 diff --git a/lang/ruby18/patches/patch-ak b/lang/ruby18/patches/patch-ak new file mode 100644 index 00000000000..22f5906bda0 --- /dev/null +++ b/lang/ruby18/patches/patch-ak @@ -0,0 +1,39 @@ +$NetBSD: patch-ak,v 1.1 2004/12/05 17:25:53 taca Exp $ + +--- lib/rexml/encodings/SHIFT_JIS.rb.orig 2003-07-17 09:22:41.000000000 +0900 ++++ lib/rexml/encodings/SHIFT_JIS.rb +@@ -1,33 +1 @@ +-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 +- 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 ++load 'rexml/encodings/SHIFT-JIS.rb' |