Re: [patch] Unicode support for GTK, QT, TK
Sascha Silbe <[email protected]> Wed, 27 Aug 2003 02:59:40 +0200
| Newsgroups | gmane.comp.python.anygui.devel |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Aug 26, 2003 at 06:24:17PM +0200, Magnus Lie Hetland wrote:
> Sounds sensible. Will this work for all platforms with these backends
> (i.e. Windows and UNIX/Linux)?
Unfortunately no. I could only test the TK backend under Windows, but
even that one breaks:
=== Begin ===
File "c:\Dokumente und Einstellungen\silbe\Eigene
Dateien\anygui\lib\anygui\backends\tkgui.py", line 454, in setItems
self.widget.insert(Tkinter.END, unicode(item))
UnicodeDecodeError: 'ascii' codec can't decode byte 0x84 in position 0:
ordinal not in range(128)
=== End ===
Has anyone before tried to use non-ASCII characters with Tkinter under
Python 2.3/Windows?
I found some tips how to make it work (some locale hacks), but
sys.setdefaultencoding is gone in Python 2.3.
It would be great if someone else could check Qt/Windows, since I don't
have a license for that.
> I have no objections to adding this, except if it breaks something;
> any input on that?
As of now, you should not include it unmodified.
> Also: Does it work with Python 2.1?
From the Python docs:
> unicode(object[, encoding[, errors]])
> [...]
> New in version 2.0. Changed in version 2.2: Support for
> __unicode__() added.
So 2.1 should work for strings and maybe some basic Python types like
lists, but for complex types Python 2.2 is needed.
I could verify that if you wish.
> (I see no great harm in migrating to 2.2 soon, since we're obviously
> still in an early stage, after all.)
I'd think so, too. Even requiring Python 2.3 would do no harm
considering the current development speed. Anyone willing to test alpha
quality software should also be willing to install the latest stable
release of some other software.
CU/Lnx Sascha
--
Registered Linux User #77587 (http://counter.li.org/)
bomb terrorist afghanistan PGP encrypt CIA FBI BND MAD StaSi anschlag
strike sex pussy xxx kill bj hitler Gates MS Windows ZV ZDV
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/TAJ8Fu2Z2HTlz4cRAkwYAKCMs/zebbnJAxDg+ULClxbueNxlggCfQym7 wHsTu1VPGvhmBjoJUlPNyHM= =CJGZ -----END PGP SIGNATURE-----