You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pierre Quentel edited this page Apr 24, 2016
·
1 revision
The encoding of a page can be set by the built-in name ENCODING. It will define the Content-type header sent by the server.
It affects both the encoding used to encode the data submitted by a form, and the encoding used to transform the bytestring received on the network connection to a string printed in the browser.
If you enter Chinese or Arabic in the form field, the same string will be printed after submitting the form. If another encoding was specified, the script would either raise an exception or print unexpected characters.
By default, ENCODING is set to sys.getdefaultencoding().