Skip to content

Commit 7ba0a72

Browse files
committed
test: failing multibyte unicode test
From #2410
1 parent 242f170 commit 7ba0a72

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/xml/test_c14n.rb

+16
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,21 @@ 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+
246+
# I do not understand what's going on here
247+
expected = if Nokogiri.jruby?
248+
%{<foo>𡏅</foo>}
249+
else
250+
%{<foo>陝</foo>}
251+
end
252+
253+
result = doc.canonicalize
254+
assert_equal(expected, result)
255+
end
240256
end
241257
end
242258
end

0 commit comments

Comments
 (0)