diff --git a/spec/std/xml/xml_spec.cr b/spec/std/xml/xml_spec.cr index efbb79e6e226..6ad874fb290a 100644 --- a/spec/std/xml/xml_spec.cr +++ b/spec/std/xml/xml_spec.cr @@ -419,6 +419,38 @@ describe XML do assert_prints node.to_xml, %(
<foo>
) end + it "parses HTML UTF-8 from memory (#13703)" do + doc = XML.parse_html("České psaní
") + + node = doc.root.try(&.children.first).should_not be_nil + + node.text.should eq "České psaní" + end + + it "parses HTML UTF-8 from IO (#13703)" do + doc = XML.parse_html(IO::Memory.new("České psaní
")) + + node = doc.root.try(&.children.first).should_not be_nil + + node.text.should eq "České psaní" + end + + it "parses XML UTF-8 from memory (#13703)" do + doc = XML.parse("České psaní
") + + node = doc.root.try(&.children.first).should_not be_nil + + node.text.should eq "České psaní" + end + + it "parses XML UTF-8 from IO (#13703)" do + doc = XML.parse(IO::Memory.new("České psaní
")) + + node = doc.root.try(&.children.first).should_not be_nil + + node.text.should eq "České psaní" + end + it "gets empty content" do doc = XML.parse("