[Product-Developers] Re: UnicodeDecodeError

Andreas Jung lists at zopyx.com
Tue Mar 25 12:26:10 UTC 2008

--On 25. März 2008 08:49:58 -0300 Walter Cruz 
<waltercruz at threepointsweb.com> wrote:

> 2008/3/24, Andreas Jung <lists at zopyx.com>:
>> What are you talking about? Python has nothing like a 'unicode' default.
>>  Likely you're referring to sys.getdefaultencoding() which is ascii by
>>  default. General rule #1: don't touch that. Rule #2: if you have the
>>  need to touch the default encoding as a workaround: better fix your
>>  code first.
>>  -aj
> Yes. It's a common practice to set the default encoding of python to
> utf8 (sitecustomize.py). At least for plone developers that go beyond
> the ascii :)

If you do that then you don't know what your doing. Sorry for being harsh 
:-) If you write software depending on a particular default encoding
!= ascii then you should learn how to write proper plone code. No Plone 
application should depend on a particular default encoding other than ascii.
And in general there is absolutely no need for changing the default 
encoding for Plone - except for using badly written code causing unicode 
for whatever reason. Setting the default encoding is just a _very dirty_
workaround. Don#t call it bad practice. Any software depending on a 
particular default encoding other than ascii belongs into the trashcan.

As German we do of course deal with non-ascii..we deal with UTF8 and 
ISO-8859-15 every day in various setups _without_ having to change
the default encoding.

> A minimal test is to change the property named title from a type xml
> to anything with a accented char.

Such a situation requires a bugreport and a fix for fixing the particular
problem. I would _never_ change the default encoding for any site because
of the lessons learned in the past.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20080325/53fb01a0/attachment.asc>

More information about the Product-Developers mailing list