From: "mame (Yusuke Endoh) via ruby-core" Date: 2023-03-09T11:07:29+00:00 Subject: [ruby-core:112782] [Ruby master Bug#19455] Ruby 3.2: wrong Regexp encoding with non-ASCII comments Issue #19455 has been updated by mame (Yusuke Endoh). Discussed at the dev meeting. @matz said he would prefer 3.1 behavior if possible (but not high priority). @nobu said he would take a look. ---------------------------------------- Bug #19455: Ruby 3.2: wrong Regexp encoding with non-ASCII comments https://bugs.ruby-lang.org/issues/19455#change-102280 * Author: janosch-x (Janosch M�ller) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.0 (2022-12-25 revision a528908271) * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- comments and comment groups don't trigger the correct `Regexp#encoding` on Ruby 3.2 anymore: ```ruby # ruby 3.1 /#a/x.encoding # => # # OK /(?#a)/.encoding # => # # OK /#�/x.encoding # => # # OK /(?#�)/.encoding # => # # OK # ruby 3.2 /#a/x.encoding # => # # OK /(?#a)/.encoding # => # # OK /#�/x.encoding # => # # BUG /(?#�)/.encoding # => # # BUG /#�/x.inspect # => "/#\\xC3\\xBC/x" /(?#�)/.inspect # => "/(?#\\xC3\\xBC)/" # bug is hidden if there are non-ascii chars outside comments /�#�/x.encoding # => # /�(?#�)/.encoding # => # ``` i think these changes might be the cause: https://github.com/ruby/ruby/commit/ec3542229b29ec93062e9d90e877ea29d3c19472#diff-c3675fa319803b2f5a775defa40694edb9a761baa3a54fa78e1fdef8f918cc7cR2837-R2890 @jeremyevans0 JFYI -- 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/