summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--test/ruby/test_io_m17n.rb14
2 files changed, 18 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 74f2a3f8d3..b74f3244aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sat Jul 11 14:43:34 2009 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/ruby/test_io_m17n.rb (test_strip_bom): added.
+
Sat Jul 11 07:11:59 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/readline/readline.c (readline_attempted_completion_function):
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb
index ce942a8528..aed688e591 100644
--- a/test/ruby/test_io_m17n.rb
+++ b/test/ruby/test_io_m17n.rb
@@ -1691,5 +1691,19 @@ EOT
assert_equal("\"&#x4E02;\"".force_encoding("ascii-8bit"), content)
}
end
+
+ def test_strip_bom
+ with_tmpdir {
+ text = "\uFEFFa"
+ %w/UTF-8 UTF-16BE UTF-16LE UTF-32BE UTF-32LE/.each do |name|
+ path = '%s-bom.txt' % name
+ content = text.encode(name)
+ generate_file(path, content)
+ result = File.read(path, mode: 'rb:utf-7-bom')
+ assert_equal(content[1].force_encoding("ascii-8bit"),
+ result.force_encoding("ascii-8bit"))
+ end
+ }
+ end
end