Why are puts
and print
results with Unicode characters not the same:
# encoding: utf-8
puts ['裤']
print ['裤']
裤
["\u88E4"]
even though they are the same when they are not in array?
puts '裤'
print '裤'
裤
裤
Is it possible to change print
so it always prints Unicode?
I don't see the difference:
But I think it was because of
:print
method prints containment of the array without joining its values together, just dump it. I believe that it uses:inspect
to print it out. I can't reproduce it, but you try to execute the following['裤'].inspect
on your system.