From: "kddnewton (Kevin Newton) via ruby-core" Date: 2026-11-09T23:18:01+00:00 Subject: [ruby-core:127391] [Ruby Bug#22519] Incompatibility between parse.y and Prism in the encoding of interpolated strings Issue #22519 has been updated by kddnewton (Kevin Newton). https://github.com/ruby/ruby/pull/19815 ---------------------------------------- Bug #22519: Incompatibility between parse.y and Prism in the encoding of interpolated strings https://bugs.ruby-lang.org/issues/22519#change-119835 * Author: mame (Yusuke Endoh) * Status: Open * Assignee: prism * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- There seems to be an incompatibility between parse.y and Prism in the encoding of interpolated strings. ```ruby # in a script file x = 1 p "#{x}#{x}".encoding # parse.y: # prism: # a = "abc".force_encoding("US-ASCII") b = "".encode("UTF-16LE") s = "#{a}#{b}" p s.encoding # parse.y: # prism: # p s # parse.y: "abc" prism: "\u6261\x63" ``` @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. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/