SimpleHTTPServer in Python3.6.4 can not handle non-ASCII string(Chinese in my case)
问题 I run SimpleHTTPServer in Python3.6.4 64bit by this command: python -m http.server --cgi then I make a form in test.py, submit it to test_form_action.py to print the input text. cgi-bin/test.py # coding=utf-8 from __future__ import unicode_literals, absolute_import print("Content-Type: text/html") # HTML is following print() reshtml = '''<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html" charset="utf-8"/> </head> <body> <div style="text-align: center;"