diff web/recent.cgi @ 30:e8f3b7994d88

Port to Python 3. All scripts and modules have been ported to Python 3 and appear to work. Some changes to the lighttpd configuration were needed.
author John "Elwin" Edwards
date Tue, 31 Dec 2013 13:36:19 -0500
parents 453278a81371
children 25843238434a
line wrap: on
line diff
--- a/web/recent.cgi	Thu Oct 31 14:33:50 2013 -0700
+++ b/web/recent.cgi	Tue Dec 31 13:36:19 2013 -0500
@@ -1,12 +1,16 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 # CGI script creating page of recent games
 
 import sys
 import time
 import rlgalldb as rlgall
 
+# It is assumed that sys.stdout uses UTF-8 encoding.  If this is not the case,
+# configure the Web server to set the LC_CTYPE environment variable to a UTF-8
+# locale.
+
 # The required header
-sys.stdout.write("Content-type: text/html\r\n\r\n")
+sys.stdout.write("Content-Type: text/html; charset=utf-8\r\n\r\n")
 # The top of the page
 sys.stdout.write(rlgall.phead.format("Recent Games"))
 sys.stdout.write(rlgall.ptop);