[#114181] [Ruby master Bug#19767] [Not really a bug, but more a not ideal notification] "historical binary regexp match" when using the "n" modifier in a ruby regex — "rubyFeedback (robert heiler) via ruby-core" <ruby-core@...>
SXNzdWUgIzE5NzY3IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHJ1YnlGZWVkYmFjayAocm9iZXJ0IGhl
3 messages
2023/07/14
[ruby-core:114214] [Ruby master Bug#19455] Ruby 3.2: wrong Regexp encoding with non-ASCII comments
From:
"nagachika (Tomoyuki Chikanaga) via ruby-core" <ruby-core@...>
Date:
2023-07-17 08:26:55 UTC
List:
ruby-core #114214
Issue #19455 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 3.0: DONTNEED, 3.1: DONTNEED, 3.2: REQUIRED to 3.0: D= ONTNEED, 3.1: DONTNEED, 3.2: DONE ruby_3_2 be09d77b966c7bcc77957927f16cefe66b365495 merged revision(s) a8ba1d= dd78544b4bda749051d44f7b2a8a0ec5ff. ---------------------------------------- Bug #19455: Ruby 3.2: wrong Regexp encoding with non-ASCII comments https://bugs.ruby-lang.org/issues/19455#change-103901 * Author: janosch-x (Janosch M=FCller) * Status: Closed * Priority: Normal * ruby -v: ruby 3.2.0 (2022-12-25 revision a528908271) * Backport: 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONE ---------------------------------------- comments and comment groups don't trigger the correct `Regexp#encoding` on = Ruby 3.2 anymore: ```ruby # ruby 3.1 /#a/x.encoding # =3D> #<Encoding:US-ASCII> # OK /(?#a)/.encoding # =3D> #<Encoding:US-ASCII> # OK /#=FC/x.encoding # =3D> #<Encoding:UTF-8> # OK /(?#=FC)/.encoding # =3D> #<Encoding:UTF-8> # OK # ruby 3.2 /#a/x.encoding # =3D> #<Encoding:US-ASCII> # OK /(?#a)/.encoding # =3D> #<Encoding:US-ASCII> # OK /#=FC/x.encoding # =3D> #<Encoding:US-ASCII> # BUG /(?#=FC)/.encoding # =3D> #<Encoding:US-ASCII> # BUG /#=FC/x.inspect # =3D> "/#\\xC3\\xBC/x" /(?#=FC)/.inspect # =3D> "/(?#\\xC3\\xBC)/" # bug is hidden if there are non-ascii chars outside comments /=FC#=FC/x.encoding # =3D> #<Encoding:UTF-8> /=FC(?#=FC)/.encoding # =3D> #<Encoding:UTF-8> ``` i think these changes might be the cause: https://github.com/ruby/ruby/comm= it/ec3542229b29ec93062e9d90e877ea29d3c19472#diff-c3675fa319803b2f5a775defa4= 0694edb9a761baa3a54fa78e1fdef8f918cc7cR2837-R2890 @jeremyevans0 JFYI --=20 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-c= ore.ml.ruby-lang.org/