You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To be able to encode valid utf8 text wrappers must be used under jruby at the moment, see below example:
code
# coding: utf-8require'nokogiri'puts"Nokogiri #{Nokogiri::VERSION}"puts"No text wrapper:"putsNokogiri::XML::Builder.new(encoding: "UTF-8"){ |xml| xml.test"test ﺵ "}.to_xmlputs"With text wrapper:"putsNokogiri::XML::Builder.new(encoding: "UTF-8"){ |xml| xml.test{xml.text"test ﺵ "}}.to_xml
output Jruby 1.7.0
Nokogiri 1.5.6.rc2
No text wrapper:
<?xml version="1.0" encoding="UTF-8"?>
<test>test ? </test>
With text wrapper:
<?xml version="1.0" encoding="UTF-8"?>
<test>test ﺵ </test>
output MRI 1.9.3
Nokogiri 1.5.6.rc2
No text wrapper:
<?xml version="1.0" encoding="UTF-8"?>
<test>test ﺵ </test>
With text wrapper:
<?xml version="1.0" encoding="UTF-8"?>
<test>test ﺵ </test>
The text was updated successfully, but these errors were encountered:
I tried to find the cause and as far as I can determine the call to encode_special_chars causes the problem, however I have yet to find out what the root cause exactly is.
I'll close this issue. Please feel free to reopen if the problem still exists. I also added a test to make sure that we don't have regression in the future.
To be able to encode valid utf8 text wrappers must be used under jruby at the moment, see below example:
code
output Jruby 1.7.0
output MRI 1.9.3
The text was updated successfully, but these errors were encountered: