diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-08-18 06:53:02 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-08-18 06:53:02 +0000 |
commit | 1ea42115afaeba2aad4bbe8567be4b938c499d31 (patch) | |
tree | f9e67d15afb00b2aff84c6aee21d2c277dba49b1 /io.c | |
parent | e1d3b318fb3ac090aa72619ec649d875d05ede08 (diff) |
merge revision(s) 5b1bf8dd2d08ae7371ecf025967376bb794ed651: [Backport #16099]
UTF LE is fixed at least the first 2 bytes
* io.c (io_strip_bom): if the first 2 bytes are 0xFF0xFE, it
should be a little-endian UTF, 16 or 32. [Bug #16099]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -6129,12 +6129,9 @@ io_strip_bom(VALUE io) return ENCINDEX_UTF_32LE; } rb_io_ungetbyte(io, b4); - rb_io_ungetbyte(io, b3); - } - else { - rb_io_ungetbyte(io, b3); - return ENCINDEX_UTF_16LE; } + rb_io_ungetbyte(io, b3); + return ENCINDEX_UTF_16LE; } rb_io_ungetbyte(io, b2); break; |