Win32com and Unicode

Martin von Loewis loewis at informatik.hu-berlin.de
Sun Jan 6 11:24:08 EST 2002


Gerhard =?iso-8859-15?Q?H=E4ring?= <gh_pythonlist at gmx.de> writes:

> I think you could set the default encoding scheme in your
> sitecustomize.py like I described here:
> 
> http://www.faqts.com/knowledge_base/view.phtml/aid/11712/fid/562

While this would solve the problem, I'd advise against that
approach. Changing site.py is that every user needs to do
individually, and it becomes impossible to test an application
reliably if your users might all have set the default encoding to a
different value.

> Or you can convert manually to ISO-8859-1 using the .encode() method of
> the string class.

That is much better (although "mbcs" and "cp1252" are probably much
alternatives on Windows, for European use). Explicit is better than
implicit.

Regards,
Martin




More information about the Python-list mailing list