Skip to content

Commit 7a28d3d

Browse files
committed
test: failing multibyte unicode test
From #2410
1 parent 1cbf06d commit 7a28d3d

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"
@@ -235,6 +236,14 @@ def test_wrong_params
235236
assert_raises(TypeError) { doc.canonicalize(nil, :wrong_type) }
236237
doc.canonicalize(nil, nil, :wrong_type)
237238
end
239+
240+
def test_multibyte_unicode
241+
# https://github.com/sparklemotion/nokogiri/issues/2410
242+
doc = Nokogiri.XML(%{<foo>𡏅</foo>}, nil, "EUC-JP")
243+
expected = %{<foo>陝</foo>}
244+
result = doc.canonicalize
245+
assert_equal(expected, result)
246+
end
238247
end
239248
end
240249
end

0 commit comments

Comments
 (0)