зеркало из https://github.com/github/ruby.git
* test/ruby/test_io_m17n.rb (test_strip_bom): added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
c51a968903
Коммит
cb7075a6a2
|
@ -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):
|
||||
|
|
|
@ -1691,5 +1691,19 @@ EOT
|
|||
assert_equal("\"丂\"".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
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче