summaryrefslogtreecommitdiff
path: root/test/ruby/test_io_m17n.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-13 23:23:43 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-13 23:38:05 +0900
commit5b1bf8dd2d08ae7371ecf025967376bb794ed651 (patch)
treef94e66f07289b3244658bddf848f65c77b115427 /test/ruby/test_io_m17n.rb
parent79f9c626b63c2ce6ed1f3e767838a02a668145ba (diff)
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]
Diffstat (limited to 'test/ruby/test_io_m17n.rb')
-rw-r--r--test/ruby/test_io_m17n.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb
index 630f2eec083..8101bfb62f3 100644
--- a/test/ruby/test_io_m17n.rb
+++ b/test/ruby/test_io_m17n.rb
@@ -2084,8 +2084,8 @@ EOT
define_method("test_strip_bom:#{name}") do
path = "#{name}-bom.txt"
with_tmpdir {
- text = "\uFEFFa"
- stripped = "a"
+ text = "\uFEFF\u0100a"
+ stripped = "\u0100a"
content = text.encode(name)
generate_file(path, content)
result = File.read(path, mode: 'rb:BOM|UTF-8')