General

Profile

thyresias (Thierry Lambert)

  • Login: thyresias
  • Email: thyresias@gmail.com
  • Registered on: 01/02/2014
  • Last sign in: 12/22/2025

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 1 8 9

Activity

11/28/2025

06:13 PM Ruby Bug #21709: Regexp interpolation is inconsistent with String interpolation
Ok.
Here is the code that shows the inconsistency Regexp/String for interpolation, from your examples:
```ruby
# inconsistent Regexp/String interpolation behavior
prefix = '\p{In_Arabic}'
suffix = '\p{In_Arabic}'.encode('US-ASCII'...
thyresias (Thierry Lambert)
10:32 AM Ruby Bug #21709: Regexp interpolation is inconsistent with String interpolation
jeremyevans0 (Jeremy Evans) wrote in #note-7:
> Sure, that sounds like a good idea.
It seems I cannot change the description, just the title.
Should I open a new bug report?
As an aside, you said about the encoding of the result ...
thyresias (Thierry Lambert)

11/25/2025

11:21 AM Ruby Bug #21709: Regexp interpolation is inconsistent with String interpolation
jeremyevans0 (Jeremy Evans) wrote in #note-5:
> I agree this represents a bug, which is why I changed the status back to Open. However, I think the bug is in the literal Regexp support, not in `Regexp.escape`.
Thank you. I agree with...
thyresias (Thierry Lambert)

11/24/2025

08:36 PM Ruby Bug #21709: Regexp interpolation is inconsistent with String interpolation
Ok for the workaround, but don't you think all this is inconsistent?
For me, it's a bug, not a feature. ^_^
thyresias (Thierry Lambert)
06:01 PM Ruby Bug #21709: Regexp interpolation is inconsistent with String interpolation
> Does this behavior cause any problems in your application?
Yes:
```ruby
search_text = "foo"
s_search = Regexp.escape(search_text)
re_prefix = /\p{In_Arabic}.+ /
s_search.prepend re_prefix.source
_re = /^#{s_search}|(?<=– |: )#...
thyresias (Thierry Lambert)
03:15 PM Ruby Bug #21709 (Open): Regexp interpolation is inconsistent with String interpolation
```ruby
%w(foo être).each do |s|
puts "string: #{s.inspect} -> #{s.encoding}"
puts "escaped: #{Regexp.escape(s).inspect} -> #{Regexp.escape(s).encoding}"
end
```
Output:
```
string: "foo" -> UTF-8
escaped: "foo" -> US-ASCII
...
thyresias (Thierry Lambert)

09/04/2025

09:21 AM Ruby Bug #21561 (Closed): Wrong encoding for File.dirname result on Windows
I placed the file containing the code below in a directory named "à_signaler" to show the effect on non-ascii characters:
```ruby
def dirname_encoding(file)
h = {
"file" => file,
"File.dirname(file)" => File.dirname(file),...
thyresias (Thierry Lambert)

09/05/2023

01:45 PM Ruby Bug #19861: Ripper does not fire any error event on unfinished heredoc
I had missed this one.
Thanks, nobu.
thyresias (Thierry Lambert)

09/04/2023

06:09 PM Ruby Bug #19861 (Closed): Ripper does not fire any error event on unfinished heredoc
```ruby
require 'ripper'
class BasicParser < Ripper
EVENTS.each do |event|
module_eval(<<~RUBY, __FILE__, __LINE__ + 1)
def on_#{event}(*args)
puts "#{event}(\#{args.inspect})"
args.unshift :#{event}
...
thyresias (Thierry Lambert)

08/25/2023

02:19 PM Ruby Bug #19851 (Closed): Ripper returns an extra block argument for :params with :args_forward
```ruby
require 'ripper'
class BasicParser < Ripper
EVENTS.each do |event|
module_eval(<<~RUBY, __FILE__, __LINE__ + 1)
def on_#{event}(*args)
puts "#{event}(\#{args.inspect})"
args.unshift :#{event}
...
thyresias (Thierry Lambert)

Also available in: Atom