Skip to content

Instantly share code, notes, and snippets.

@kasei
Created June 30, 2010 16:47
Show Gist options
  • Save kasei/458923 to your computer and use it in GitHub Desktop.
Save kasei/458923 to your computer and use it in GitHub Desktop.
HTML::HTML5::Writer bug
#!/usr/bin/perl
use strict;
use warnings;
use HTML::HTML5::Writer;
use HTML::HTML5::Parser;
use RDF::Trine qw(iri statement literal);
my $html = <<'END';
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>SPARQL</title></head><body>
<p><code>
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/><br/>
SELECT ?name (SAMPLE(?i) AS ?image)<br/>
WHERE {<br/>
&nbsp; ?i a foaf:Image ; foaf:depicts [<br/>
a foaf:Person ;<br/>
foaf:name ?name<br/>
] .<br/>
}
</code></p>
</body></html>
END
my $doc = HTML::HTML5::Parser->new->parse_string($html);
print HTML::HTML5::Writer->new->document($doc);
@kasei
Copy link
Author

kasei commented Jun 30, 2010

Malformed UTF-8 character (fatal) at /ext/local/lib/perl5/site_perl/5.10.1/HTML/HTML5/Writer.pm line 293.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment