Turned CGI script into a (WSGI-compliant) Flask application. Use UTF-8.