On Jun 18, 9:39 am, "Ville M. Vainio" <[email protected]> wrote:
> On Thu, Jun 18, 2009 at 5:18 PM, Edward K. Ream<[email protected]> wrote:
> > P.S.  The reason I keep going on about g.toUnicode is that it is the
> > foundation of Leo3k.  In particular, the 'unicode' function does not exist
> > in Py3k, and so it must be wrapped.
>
> But then it should be just aliased to str.

That's what happens.  Take a look.

BTW, I have a half memory that the reason g.toUnicode has the fairly
bizarre coding style is to avoid Python errors.  Even so, pylint
complains that 'byte' doesn't exist, at least when pylint is run with
Python 2.x. I should probably have added a note to myself...

> 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!

> - Read file, producing unicode

The process of reading the file, passing .leo files to sax, and
getting objects (vnodes, etc) containing unicode is a bit
complicated.  For example, we have to clean characters that would
cause sax to choke before sending those characters to sax.  These
problems are likely unavoidable, but I believe the Leo3k code will
work pretty much as is.

Edward
--~--~---------~--~----~------------~-------~--~----~
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