Skip to content

Commit

Permalink
Fix failing test case on musl based Linux
Browse files Browse the repository at this point in the history
Musl doesn't recognize cp932 encoding.
It also fails when used on the command line with iconv.
For this test case cp932 can be replaced by Shift_JIS, which is identical for the characters in question and that is handled by musl.

Error was:

  1) Error:
Nokogiri::HTML::TestDocumentEncoding#test_encoding_without_charset:
ArgumentError: invalid byte sequence in UTF-8
    /home/lars/comcard/nokogiri/test/html/test_document_encoding.rb:26:in `test_encoding_without_charset'

Related to sparklemotion#1983
larskanis committed Feb 7, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 659c923 commit 61dadef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/html/test_document_encoding.rb
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ def test_encoding
end

def test_encoding_without_charset
doc = Nokogiri::HTML File.open(SHIFT_JIS_NO_CHARSET, 'r:cp932:cp932').read
doc = Nokogiri::HTML File.open(SHIFT_JIS_NO_CHARSET, 'r:Shift_JIS:Shift_JIS').read

hello = "こんにちは"

0 comments on commit 61dadef

Please sign in to comment.