Skip to content

Commit 8f2ffea

Browse files
committed
test: failing multibyte unicode test
From #2410
1 parent 905ba6b commit 8f2ffea

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/xml/test_c14n.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# coding: utf-8
12
# frozen_string_literal: true
23

34
require "helper"
@@ -237,6 +238,14 @@ def test_wrong_params
237238
assert_raises(TypeError) { doc.canonicalize(nil, :wrong_type) }
238239
doc.canonicalize(nil, nil, :wrong_type)
239240
end
241+
242+
def test_multibyte_unicode
243+
# https://github.com/sparklemotion/nokogiri/issues/2410
244+
doc = Nokogiri.XML(%{<foo>𡏅</foo>}, nil, "EUC-JP")
245+
expected = %{<foo>陝</foo>}
246+
result = doc.canonicalize
247+
assert_equal(expected, result)
248+
end
240249
end
241250
end
242251
end

0 commit comments

Comments
 (0)