Skip to content

Commit f79931f

Browse files
committed
fix invalid utf-8 test under ruby 1.9
1 parent a58ab5f commit f79931f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/client/tc_utf8_escaping.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class UTF8Test < Test::Unit::TestCase
55
def test_escaping_invalid_utf_8_characters
66
client = OAI::Client.new 'http://localhost:3333/oai' #, :parser => 'libxml'
77
invalid_utf_8 = [2, 3, 4, 104, 5, 101, 6, 108, 66897, 108, 66535, 111, 1114112, 33, 55234123, 33].pack("U*")
8+
invalid_utf_8 = invalid_utf_8.force_encoding("binary") if invalid_utf_8.respond_to? :force_encoding
89
assert_equal("hello!!", client.send(:strip_invalid_utf_8_chars, invalid_utf_8).gsub(/\?/, ''))
910
end
1011

0 commit comments

Comments
 (0)