diff options
Diffstat (limited to 'test/test_parser.rb')
-rwxr-xr-x | test/test_parser.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/test_parser.rb b/test/test_parser.rb index e096196..3614799 100755 --- a/test/test_parser.rb +++ b/test/test_parser.rb @@ -90,6 +90,16 @@ class TestParser < Test::Unit::TestCase assert_nil data end -end + def test_filename_or_xml_is_encoded_with_ascii_8bit + # skip if Ruby version does not support String#force_encoding + return unless String.method_defined?(:force_encoding) + + xml = File.read("test/assets/non-ascii-but-utf-8.plist") + xml.force_encoding("ASCII-8BIT") -__END__ + assert_nothing_raised do + data = Plist::parse_xml(xml) + assert_equal("\u0099", data["non-ascii-but-utf8-character"]) + end + end +end |