We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
问题是这样的,我用python3写后台CGI的时候,print了中文,但是页面显示不出来
后台代码这个样子: 前台代码这个样子:
调试的时候发现这中文其实已经传过来了 但显示不了,我以为是编码的问题,把以前对编码的总结又翻了一遍,还google了一下,发现网上的解决方法有两种:
import codecs, sys sys.stdout = codecs.getwriter('utf8')(sys.stdout.buffer)
print("Content-type: application/json; charset="utf-8"\r\n\r\n")
第二条早上起来,就把这两种方法都试了下,发现都不行。。。
最后发现问题在哪儿呢? 变量名字写错了!前台读的location,我后台传的loction。我勒个去,就这bug,看了我好久没看出来。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
后台代码这个样子:


前台代码这个样子:
调试的时候发现这中文其实已经传过来了

但显示不了,我以为是编码的问题,把以前对编码的总结又翻了一遍,还google了一下,发现网上的解决方法有两种:
第二条早上起来,就把这两种方法都试了下,发现都不行。。。
最后发现问题在哪儿呢?
变量名字写错了!前台读的location,我后台传的loction。我勒个去,就这bug,看了我好久没看出来。
The text was updated successfully, but these errors were encountered: