Commit da3126ce authored by Paul Berry's avatar Paul Berry

Changed piglit-summary-html to explicitly encode its output as UTF-8.

Previously piglit-summary-html didn't explicitly encode its output at
all--it relied on the default behavior of the Python file.write()
method (which, in Python 2.x, is to write 8-bit strings verbatim and
to encode unicode strings using ASCII).  This meant that if a
non-ASCII character appeared in any of the test data,
piglit-summary-html would fail with an exception.

This patch changes piglit-summary-html to explicitly encode its output
using UTF-8.  It also updates all of the HTML templates to specify
UTF-8 as the encoding, so that when results are viewed in a web
browser, non-ASCII characters will display correctly.
parent 4da714cd
......@@ -50,7 +50,7 @@ def readfile(filename):
def writefile(filename, text):
f = open(filename, "w")
f.write(text)
f.write(text.encode('utf-8'))
f.close()
templatedir = os.path.join(os.path.dirname(__file__), 'templates')
......
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Result summary </title>
<link rel="stylesheet" href="index.css"/>
</head>
......
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>%(path)s - Details</title>
<link rel="stylesheet" href="../result.css"/>
</head>
......
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>%(name)s - System info</title>
<link rel="stylesheet" href="../result.css"/>
</head>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment