From: Dan Scott <dscott@laurentian.ca>
Date: Thu, 22 Sep 2011 16:51:22 +0000 (-0400)
Subject: LP856567: Mark HTML report output as Unicode-encoded
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4d0676d86ab0c8c85416666d6fcb73c64457647c;p=evergreen%2Fmasslnc.git

LP856567: Mark HTML report output as Unicode-encoded

Non-ASCII characters in report ouput that has been generated in HTML
format appears to be corrupted when viewed in a browser. This can be
manually corrected by switching the "Encoding" browser option, but it
would be better to include <meta charset='utf-8'> in the output HTML to
tell the browser directly.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
---

diff --git a/Open-ILS/src/reporter/clark-kent.pl b/Open-ILS/src/reporter/clark-kent.pl
index d61878252c..e8cf88d361 100755
--- a/Open-ILS/src/reporter/clark-kent.pl
+++ b/Open-ILS/src/reporter/clark-kent.pl
@@ -443,6 +443,7 @@ sub build_html {
 	print $index <<"	HEADER";
 <html>
 	<head>
+		<meta charset='utf-8'>
 		<title>$$r{report}{name}</title>
 		<style>
 			table { border-collapse: collapse; }
@@ -474,7 +475,7 @@ sub build_html {
 	push @links, "<a class='dim' href='report-data.html.debug.html'>Debugging Info</a>";
 
 	my $debug = new FileHandle (">$file.debug.html") or die "Cannot write to '$file.debug.html'";
-	print $debug "<html><head><title>DEBUG: $$r{report}{name}</title></head><body>";
+	print $debug "<html><head><meta charset='utf-8'><title>DEBUG: $$r{report}{name}</title></head><body>";
 
 	{	no warnings;
 		print $debug '<h1>Generated SQL</h1><pre>' . $r->{resultset}->toSQL() . "</pre><a href='$file'>Back to output index</a><hr/>";
@@ -496,7 +497,7 @@ sub build_html {
 	if ($r->{html_format}) {
 		# create the raw output html file
 		my $raw = new FileHandle (">$file.raw.html") or die "Cannot write to '$file.raw.html'";
-		print $raw "<html><head><title>$$r{report}{name}</title>";
+		print $raw "<html><head><meta charset='utf-8'><title>$$r{report}{name}</title>";
 
 		print $raw <<'		CSS';
 			<style>