Open guai opened 11 years ago
I guess the issue is, how not to escape unicode. It might be useful for debugging at some points but if it is your primary character encoding (think Chinese?), then you would just want unicode characters to stay that way.
@guai @coezbek
Under the hood we use Ruby's inspect
method which respects the value of the default external encoding when deciding how to generate output. (see: https://ruby-doc.org/core-2.3.3/Object.html#method-i-inspect)
require 'awesome_print'
Encoding.default_external = Encoding::ISO_8859_1
ap '我爱北京' # output: "\u6211\u7231\u5317\u4EAC"
Encoding.default_external = Encoding::UTF_8
ap '我爱北京' # output: "我爱北京"
Thank for following up @coezbek. I had not seen this issue till now. Please let me know if this solves the issue. :)
Could you elaborate what's wrong with that and what would you rather expect?