From 1448668244c81cfc720bcdfa93af352a17cc230f Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 1 Jan 2008 05:43:50 +0000 Subject: * lib/rexml: 1.9 patch from Sam Ruby mentioned in his blog: [ruby-core:14639] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rexml/functions.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/rexml/functions.rb') diff --git a/lib/rexml/functions.rb b/lib/rexml/functions.rb index 8293e9c5ac..b3c89877e5 100644 --- a/lib/rexml/functions.rb +++ b/lib/rexml/functions.rb @@ -256,9 +256,15 @@ module REXML end } - string(string).unpack('U*').collect { |c| - if map.has_key? c then map[c] else c end - }.compact.pack('U*') + if ''.respond_to? :chars + string(string).chars.collect { |c| + if map.has_key? c then map[c] else c end + }.compact.join + else + string(string).unpack('U*').collect { |c| + if map.has_key? c then map[c] else c end + }.compact.pack('U*') + end end # UNTESTED -- cgit v1.2.3