correcting cgi-scripts for encoding issues in python3