Actions
Bug #22519
closedIncompatibility between parse.y and Prism in the encoding of interpolated strings
Bug #22519:
Incompatibility between parse.y and Prism in the encoding of interpolated strings
Description
There seems to be an incompatibility between parse.y and Prism in the encoding of interpolated strings.
# in a script file
x = 1
p "#{x}#{x}".encoding # parse.y: #<Encoding:UTF-8> prism: #<Encoding:US-ASCII>
a = "abc".force_encoding("US-ASCII")
b = "".encode("UTF-16LE")
s = "#{a}#{b}"
p s.encoding # parse.y: #<Encoding:UTF-8> prism: #<Encoding:UTF-16LE>
p s # parse.y: "abc" prism: "\u6261\x63"
@naruse (Yui NARUSE) says the behavior of parse.y is correct. This is probably a bug in the Prism compiler, but I have not looked into it in detail.
With -e, the result of parse.y seems to depend on the locale encoding (the LANG environment variable). I have not looked into the details of this either.
Actions