gnue-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnue-dev] Unicode + wxPython


From: Aditya Gilra
Subject: Re: [Gnue-dev] Unicode + wxPython
Date: Fri, 23 Aug 2002 08:35:57 -0700 (PDT)

||Shriharih||

God-Remembrance.

--- Arturas Kriukovas <address@hidden> wrote:
> 0. Well, about a half year ago i found some
> documentation mentioning
> that current versions of wxPython do not support
> unicode (or utf-8) and
> that support will be only from the next version
> (2.3.3 if i'm not
> mistakening). So i was a bit astonished seeing that
> it works, at least
> half of it works.

wxPython does not support unicode but wxWindows 2.3.2
does. utf-8 is simply passed by wxPython as a latin-1
string and wxWindows parses it as Unicode. That's my
theory, dunno exactly.

> 1. I have not yet cleared for myself what exactly
> changes would be
> needed, but if you say that only a few lines - the
> better.
> 2. We cannot do anything about it now, and we'll
> need do nothing later
> [at least i hope so] (when support for Hindi and
> other languages will
> be implemented (?) in wxWindows). We'll have to wait
> with this now and
> use your pygtk.
> 

I don't think it'll be too long before we have
wxWindows (wxGTK) 2.3.3 out. And wxPython will happily
continue to pass utf-8 strings thinking they are
latin-1 and wxGTK will use them well.

But HEY, pygtk2 is much much faster than wxPython, at
least startup is. It works on windows too (but without
ligaturing, last I'd seen). So what's with wxPython?

- Aditya.

> 
> Arturas
> 
> On Fri, Aug 23, 2002 at 05:19:07AM -0700, Aditya
> Gilra wrote:
> > ||Shriharih||
> > 
> > God-remembrance.
> > 
> > Unicode encoded as utf-8 has been working for me
> in
> > wxpython forms and postgresql since forms 0.1 .
> utf-16
> > has not worked and is not needed either.
> > 
> > ----------
> > BUT there are issues -
> > 
> > 1. utf-8 is a variable-length multi-byte encoding.
> > Whenever you use arrow keys in a text field
> len(str)
> > where str is a utf-8 encoded plain string will not
> > work. You will need to use
> len(unicode(str,"utf-8"))
> > to give you the correct length. At the end of
> cursor
> > movement, you will need to convert back to utf-8
> using
> > codecs.utf_8_encode(ustr)[0].
> > 
> > forms-0.1 required many changes, but the latest
> > forms-0.3 requires only 2-3 lines change in one
> file
> > which I have send as part of my pygtk patch.
> > 
> > --------
> > AND 1 problem with wx Windows.
> > 
> > 2. This is not an issue with most languages but it
> is
> > with Hindi and most Indic & Arabic scripts.
> Ligaturing
> > based on adjacent characters is essential for
> proper
> > display of Hindi. Present wxWindows is based on
> > gtk+-1.2 which does not use pango. So it is
> useless
> > for us in India. 
> > 
> > However, the latest wxWindows CVS has an
> enable-gtk2
> > configure option which will enable gtk2 which uses
> > pango. Once we have the next version of wxWindows
> and
> > wxPython, Hindi ligaturing will work. Till then, I
> > must use my pygtk form.
> > 
> > - Aditya.

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]