[New-bugs-announce] [issue6590] Py3K can't set the browser's character encoding! (CGI)

Hakan report at bugs.python.org
Tue Jul 28 11:43:01 CEST 2009

New submission from Hakan <physic.tr at gmail.com>:

I'm new to web programming with Python.
In Python2k, the special "# -*- coding: cp1254 -*-" code sets the
character encoding. It works in the internet browsers too and sets the
browser's character encoding. That was really good. But in Py3k, that
special comment doesn't work. Usually, the encoding is UTF-8 in my
browser. That time, non-ascii Turkish characters seems strange symbols.
The locale.setlocale method doesn't work too. The users must manualy set
the encoding from UTF-8 to Turkish(Windows-1254) or Turkish(ISO-8859-9).
Is there anyway to set browser's encoding with Python 3.1? 
I use IIS7 and Windows 7 x64.
BTW, the ASP don't identify Python. But I can use .py files. So, I did
these thing in CGI/.py

components: Unicode
messages: 91003
nosy: [PhysiC]
severity: normal
status: open
title: Py3K can't set the browser's character encoding! (CGI)
type: feature request
versions: Python 3.1

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list