results2html: Properly encode output in UTF-8.
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 25 Feb 2011 05:01:31 +0000 (21:01 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 25 Feb 2011 05:01:31 +0000 (21:01 -0800)
Otherwise quote marks appear as funny characters.

results2html

index 4e3224fca3ba9589f147706469845ed5692612e0..a5a7688e5a8b040e534be21267409628eb6f635b 100755 (executable)
@@ -4,9 +4,13 @@ use strict;
 use warnings;
 
 use File::Spec;
-use HTML::Entities;
+use HTML::Entities qw();
 use URI::Escape;
 
+sub encode_entities {
+    return HTML::Entities::encode_entities($_[0], "<&>'\"");
+}
+
 my $gitweb_url = 'http://benpfaff.org/cgi-bin/gitweb.cgi?p=pspp;a=blob;f=[FILE];hb=[BRANCH]#l[LINE]';
 
 open (LOG, '<', "LOG");
@@ -15,6 +19,7 @@ open (LOG_HTML, '>', "log.html");
 print LOG_HTML <<EOF;
 <html>
 <head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <link rel="stylesheet" href="build.css">
 </head>
 <body>