-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Labels
Milestone
Description
Encoding::Converter#primitive_convert seems to have a trailing null byte. More accurately, the ByteList end pointer seems to be off by one.
str = "あいうえお"
dst = ""
ec = Encoding::Converter.new str.encoding, Encoding::ISO_2022_JP, 0
ec.primitive_convert str.dup, dst, nil, nil, 0
p dst 0
MRI 2.2.1:
> ruby -v
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
> ruby yo.rb
"\e\x24\x42\x24\x22\x24\x24\x24\x26\x24\x28\x24\x2A\e\x28\x42"
JRuby 9k:
> bin/jruby -v
jruby 9.0.0.0-SNAPSHOT (2.2.1) 2015-03-26 20c6a62 Java HotSpot(TM) 64-Bit Server VM 24.76-b04 on 1.7.0_76-b13 +jit [linux-amd64]
> bin/jruby yo.rb
"\e\x24\x42\x24\x22\x24\x24\x24\x26\x24\x28\x24\x2A\e\x28\x42\x00"
Reactions are currently unavailable