On Thu, Jun 18, 2009 at 5:54 PM, Edward K. Ream<[email protected]> wrote:

>> There are 2 separate operations:
>>
>> - Extract unicode object from QString
>
> Once we have a QString, all our problems are solved.  A QString is
> simply a wrapper for a unicode object.  As such, there are is no
> decoding to be done because unicode objects have no encoding!

Yeah, that's why we shouldn't use g.toUnicode with QStrings (i.e. we
shouldn't change unicode() to g.toUnicode in qt ui).

We should probably create g.ucode (for py3 compatibility), so that:

if python3:

    g.ucode = str

else:

    g.ucode = unicode


In fact, I think that should be used for most other cases as well,
failing loudly when 'ascii' encoding doesn't work. These problems get
much easier to debug if we get early warning about bugs, as opposed to
failing silently (creating ? characters on errors, etc).

Also:

http://tarekziade.wordpress.com/2008/01/08/syssetdefaultencoding-is-evil/


-- 
Ville M. Vainio
http://tinyurl.com/vainio

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to