From: "tenderlovemaking (Aaron Patterson) via ruby-core" Date: 2024-05-02T18:13:02+00:00 Subject: [ruby-core:117753] [Ruby master Bug#20466] Interpolated regular expressions have different encoding than interpolated strings Issue #20466 has been reported by tenderlovemaking (Aaron Patterson). ---------------------------------------- Bug #20466: Interpolated regular expressions have different encoding than interpolated strings https://bugs.ruby-lang.org/issues/20466 * Author: tenderlovemaking (Aaron Patterson) * Status: Open * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- When the encoding is set to US-ASCII, interpolated strings can have different encoding than interpolated regular expressions. I think they should have the same encoding: ```ruby # encoding: US-ASCII t0 = '\\xc1' t1 = "#{t0}" re = /#{t0}/ p [t0.encoding, t1.encoding, re.encoding] ``` Output is: ``` $ ./miniruby -v test.rb ruby 3.4.0dev (2024-05-02T15:27:18Z master 7c0cf71049) [arm64-darwin23] [#, #, #] ``` -- 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/postorius/lists/ruby-core.ml.ruby-lang.org/