You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For regular expression /#{ }\xc2\xa1/e, which comes from test_m17n.rb in CRuby tests, the flags are respectively forced_utf8_encoding and forced_binary_encoding for source encoding UTF-8 and US-ASCII.
I am not sure if this is correct or not.
We are looking at this in TruffleRuby and honoring those flags is causing to compute the wrong Regexp encoding.
I guess ideally because of the /e the parts would be "force_eucjp_encoding".
That seems the best to avoid mistakes in consumers.
Or maybe no flags, and let the consumer attach the encoding correctly, though more error-prone it might be better than (arguably) the "wrong" encoding flag.
Sort of related: https://bugs.ruby-lang.org/issues/20406
We're trying to figure the actual rules for a Regexp literal's Regexp#encoding.
There is actually some docs on it in ri Regexp from Ruby 3.3.
Yeah I'm tempted to not add any additional flags as it's already pretty confusing. But I'm working through the CRuby failures right now, trying to get to the actual problems. I'll check back in on this ticket once I get the majority of them passing, and see if maybe we need additional information to get to 100%.
For regular expression
/#{ }\xc2\xa1/e
, which comes fromtest_m17n.rb
in CRuby tests, the flags are respectivelyforced_utf8_encoding
andforced_binary_encoding
for source encoding UTF-8 and US-ASCII.I am not sure if this is correct or not.
We are looking at this in TruffleRuby and honoring those flags is causing to compute the wrong Regexp encoding.
I guess ideally because of the
/e
the parts would be "force_eucjp_encoding".That seems the best to avoid mistakes in consumers.
Or maybe no flags, and let the consumer attach the encoding correctly, though more error-prone it might be better than (arguably) the "wrong" encoding flag.
@kddnewton WDYT?
cc @andrykonchin
The text was updated successfully, but these errors were encountered: