We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a0500f7 commit 7b7b1d5Copy full SHA for 7b7b1d5
test/xml/test_c14n.rb
@@ -1,3 +1,4 @@
1
+# coding: utf-8
2
# frozen_string_literal: true
3
4
require "helper"
@@ -237,6 +238,21 @@ def test_wrong_params
237
238
assert_raises(TypeError) { doc.canonicalize(nil, :wrong_type) }
239
doc.canonicalize(nil, nil, :wrong_type)
240
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
256
257
258
0 commit comments