summaryrefslogtreecommitdiff
path: root/lang/ruby18/patches
diff options
context:
space:
mode:
authortaca <taca>2004-12-05 17:25:53 +0000
committertaca <taca>2004-12-05 17:25:53 +0000
commit6c4a7b28e874db7f3f028356b1d89a6e786b2e76 (patch)
treed3c3d9864c4c049e962be8895df78a4cc39f9377 /lang/ruby18/patches
parentfda5f180516f0e217fe8ba3e9c37f7a7219c0ae1 (diff)
downloadpkgsrc-6c4a7b28e874db7f3f028356b1d89a6e786b2e76.tar.gz
Import minimum change from ruby-rexml's changes:
- Fix Iconv::iconv error with "Shift_JIS" processing. - Fix method name mistake. - As ruby-rexml, rexml/encodings/SHIFT_JIS is now simply loads SHIFT-JIS.rb in the same directory. Bump package revision.
Diffstat (limited to 'lang/ruby18/patches')
-rw-r--r--lang/ruby18/patches/patch-aj32
-rw-r--r--lang/ruby18/patches/patch-ak39
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'