"Fredrik Lundh" <[EMAIL PROTECTED]> writes on Sat, 19 Feb 2005 18:44:27 +0100:
> "aurora" <[EMAIL PROTECTED]> wrote:
> 
> > I don't want to mix them. But how could I find them? How do I know this  
> > statement can be 
> > potential problem
> >
> >   if a==b:
> >
> > where a and b can be instantiated individually far away from this line of  
> > code that put them 
> > together?

I do understand aurora's problems very well.

Me, too, I had suffered from this occasionally:

   * some library decides to use unicode (without I had asked it to do so)

   * Python decides then to convert other strings to unicode
     and bum: "Unicode decode error".

I solve these issues with a "sys.setdefaultencoding(ourDefaultEncoding)"
in "sitecustomize.py".

I know that almost all the characters I have to handle
are encoded in "ourDefaultEncoding" and if something
converts to Unicode without being asked for, then this
is precisely the correct encoding.

I know that Unicode fanatists do not like "setdefaultencoding"
but until we will have completely converted to Unicode (which we probably
will do in the farer future), this is essential to keep sane...


Dieter
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to