[Zope] Unicode Error

Toby Dickenson tdickenson@geminidataloggers.com
Thu, 31 Oct 2002 21:34:28 +0000


On Thursday 31 October 2002 8:27 pm, Dieter Maurer wrote:

>   Python uses the "defaultencoding" for such conversions.
>   If it is not specified in "sitecustomize.py", Python
>   uses ASCII encoding. Thus, when you unicode string contains
>   a non-ASCII character, you get the above exception.
>
> As you live in a Western country, you probably should set
> "sys.setdefaultencoding('iso-8859-1')" in your
> "sitecustomize.py".

I dont think that is good advice. sys.setdefaultencoding is left over fro=
m the=20
early days of python unicode development. It is likely to disappear in fu=
ture=20
versions of python. Alot of code legitimately assumes the default encodin=
g is=20
ascii, and may break if you change it.