diff options
author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-04 14:21:24 +0000 |
---|---|---|
committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-04 14:21:24 +0000 |
commit | 3c887f64a4ac54a3f931b8ef1030470b23b52224 (patch) | |
tree | 8fe1e1d27b539aa36f3e66d25ec660c6c6ed395d /ext/tk/lib/tk | |
parent | ee088875f15007f290a4101eb89e9c71b99a9b51 (diff) |
* ext/tk/lib/tk.rb (TkComm#array2tk_list): accept enc-mode argument to
decide whether convert encoding of each element or not.
* ext/tk/lib/tk/variable.rb (TkVariable#value=): fail to convert the
encoding of array elements when assign an array to an TkVariable
object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tk')
-rw-r--r-- | ext/tk/lib/tk/variable.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/tk/lib/tk/variable.rb b/ext/tk/lib/tk/variable.rb index cdf6441b6d..b5059862f3 100644 --- a/ext/tk/lib/tk/variable.rb +++ b/ext/tk/lib/tk/variable.rb @@ -468,7 +468,7 @@ if USE_TCLs_SET_VARIABLE_FUNCTIONS _get_eval_string(v, true)) } self.value - elsif val.kind_of?(Array) +# elsif val.kind_of?(Array) =begin INTERP._set_global_var(@id, '') val.each{|v| @@ -481,7 +481,7 @@ if USE_TCLs_SET_VARIABLE_FUNCTIONS } self.value =end - _fromUTF8(INTERP._set_global_var(@id, array2tk_list(val))) +# _fromUTF8(INTERP._set_global_var(@id, array2tk_list(val, true))) else #_fromUTF8(INTERP._set_global_var(@id, _toUTF8(_get_eval_string(val)))) _fromUTF8(INTERP._set_global_var(@id, _get_eval_string(val, true))) @@ -576,7 +576,7 @@ else #INTERP._invoke_without_enc('unset', @id+'(0)') elsif val.kind_of?(Array) a = [] - val.each_with_index{|e,i| a.push(i); a.push(array2tk_list(e))} + val.each_with_index{|e,i| a.push(i); a.push(array2tk_list(e, true))} #s = '"' + a.join(" ").gsub(/[\[\]$"]/, '\\\\\&') + '"' s = '"' + a.join(" ").gsub(/[\[\]$"\\]/, '\\\\\&') + '"' INTERP._eval(Kernel.format('global %s; unset %s; array set %s %s', @@ -588,7 +588,7 @@ else elsif val.kind_of?(Hash) #s = '"' + val.to_a.collect{|e| array2tk_list(e)}.join(" ")\ # .gsub(/[\[\]$"]/, '\\\\\&') + '"' - s = '"' + val.to_a.collect{|e| array2tk_list(e)}.join(" ")\ + s = '"' + val.to_a.collect{|e| array2tk_list(e, true)}.join(" ")\ .gsub(/[\[\]$\\"]/, '\\\\\&') + '"' INTERP._eval(Kernel.format('global %s; unset %s; array set %s %s', @id, @id, @id, s)) |