durusmail: quixote-users: About _decode_string(s, charset) in http_request.py
About _decode_string(s, charset) in http_request.py
2005-08-21
About _decode_string(s, charset) in http_request.py
2005-08-21
2005-08-24
About _decode_string(s, charset) in http_request.py
Damjan
2005-08-21
> > The function _decode_string(s, charset) in http_request.py improperly
> > assumes that iso-8859-1 is the default charset.
> > But the HTTPRequest class or an instance of that class can have a
> > different default charset by changing the DEFAULT_CHARSET member
> > variable.
> >
> > Actually its not very clear what that function tries to do, it seems
> > that it will return a unciode object for any other charset, but it will
> > return a byte string if the charset is 'iso-8859-1'... this seems to be
> > very wrong...
> >
> > Can someone with more knowledge explain what exactly should tihs
> > function perform???
>
> AFAIK, the function works correctly.

I thinks its very wrong for a sigle function to return different object
types in different cases... but anyway...

> > In the meanwhile I'll remove the check for iso-8859-1 from
> > _decode_string so that it always returns a ".decode"-ed unicode object,
> > and see if something breaks.
>
> If your application can handle unicode strings correctly then that
> should have no bad effect.

So far so good, I'm only using unicode objects in my application...
But unfortunetally not all of quixote is ready for unicode. For example the
logger.py component can't write unicode objects.


--
damjan | дамјан
This is my jabber ID --> damjan@bagra.net.mk <-- not my mail address!!!
reply