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
My notes from then:
This turns out to be a bug in Kernel#sprintf. Replacing with IO#write(byte.chr(Encoding::BINARY)) produces the correct image.
The logic there seems to mostly ignore encodings, which is obviously wrong.
There is already a failing spec showing the problem:
"Kernel#sprintf other formats c supports Unicode characters" which can be run with:
$ jt test spec/ruby/core/kernel/sprintf_spec.rb
I started to work on it but gave up because this logic is fundamentally problematic as it uses Java strings for formatting, losing encoding information, instead of using byte[] or Ruby String methods.
Found while working on #2368.
The text was updated successfully, but these errors were encountered: