ICU wrapper for Python?

Fredrik Juhlin laz at strakt.com
Tue Mar 5 11:09:53 EST 2002


On Tue, Mar 05, 2002 at 04:30:41PM +0100, Martin von Loewis wrote:
> Fredrik Juhlin <laz at strakt.com> writes:
> 
> > However, I'm relying on the fact that since Python uses UCS-2 and ICU uses
> > UTF-16 for their respective internal format, any Python unicode string can
> > be used as an ICU unicode string. So for the collation I don't need to do
> > any conversion between the two. To expose the codecs, one would have to
> > convert the resulting strings from UTF-16 to UCS-2.
> 
> I'm a bit slow here: Why do you think Python uses UCS-2 and not
> (simultaneously) UTF-16? What kind of conversion would you perform?
Maybe I'm the one that's slow, or possibly horribly confused.
Actually, I'm pretty damn sure that the docs I read at home said that
Python used UCS-2 rather than UTF-16. But looking at the online docs
they're saying UTF-16. So what I thought would be a problem apparently
won't be. Which is good news :)

> > If you're interested in what I have so far, I'll stick it on a web server
> > for downloading. That'll have to wait until tonight though, since my
> > latest version is at home.
> 
> That would be nice. If you don't mind, I'd also incorporate it into
> the CVS of the i18n SIG (python-codecs.sf.net - it's a bit more
> general than just codecs, hope that doesn't cause problems).
I'm not sure if you're wondering if I will have a problem with that or if
the i18n-sig will. But I want to be able to continue work on it so as long
as I can access the CVS I don't have a problem with it. I just don't know
how to go about incorporating it :)

//FJ




More information about the Python-list mailing list