B
Benny
hi,
if I have an utf8-string
utf8str = "äöü"
then Object#inspect gives me
utf8str.inspect #=> "\303\244\303\266\303\274"
but String#to_s gives me
utf8str.to_s #=> "äöü"
even if the documentation says that Object#inspect uses .to_s to convert an
object to a string.
even funnier, in the irb (I guess that is, because the irb uses
Object#inspect for the output)
irb(main):010:0>utf8str.to_s
=> "\303\244\303\266\303\274"
irb(main):010:0>utf8str.inspect
=> "\"\\303\\244\\303\\266\\303\\274\""
so how can I change Object#inspect to use String#to_s ?
any ideas?
benny
if I have an utf8-string
utf8str = "äöü"
then Object#inspect gives me
utf8str.inspect #=> "\303\244\303\266\303\274"
but String#to_s gives me
utf8str.to_s #=> "äöü"
even if the documentation says that Object#inspect uses .to_s to convert an
object to a string.
even funnier, in the irb (I guess that is, because the irb uses
Object#inspect for the output)
irb(main):010:0>utf8str.to_s
=> "\303\244\303\266\303\274"
irb(main):010:0>utf8str.inspect
=> "\"\\303\\244\\303\\266\\303\\274\""
so how can I change Object#inspect to use String#to_s ?
any ideas?
benny