[I18n-sig] Unicode implementation of python

Taquin Ho taquin.ho@projectplace.com
Fri, 2 Aug 2002 07:58:14 +0200


OK, I get the picture. site.py assigns the defaultencoding and then =
deletes=20
the method entry in sys so it cannot be called after initialization.

I received an AttributeError in site.py the first time around, but that =
must=20
have been due to a typo, then.

Works fine now. Thanks!

- Taquin

> -----Original Message-----
> From: Martin v. Loewis [mailto:martin@v.loewis.de]
> Sent: den 1 augusti 2002 18:58
> To: Taquin Ho
> Cc: i18n-sig@python.org
> Subject: Re: [I18n-sig] Unicode implementation of python
>=20
>=20
> "Taquin Ho" <taquin.ho@projectplace.com> writes:
>=20
> > Thanks, I know, but the standard version does not seem to have all
> > the unicode build.
>=20
> It sure does have Unicode support.
>=20
> > site.py gives an attribute error when it tries to execute
> > sys.setdefaultencoding(...).
>=20
> Why do you say that? Because the comment says it, or because you
> actually did get the attribute error when changing site.py?
>=20
> > See code from site.py:
> >    if encoding !=3D "ascii":
> >        # On Non-Unicode builds this will raise an AttributeError...
> >        sys.setdefaultencoding(encoding) # Needs Python=20
> Unicode build !
>=20
> I'm pretty sure that you got this exception because you tried to
> invoke sys.setdefaultencoding outside of site.py
>=20
> > Once again, anyone know how to activate the unicode support, without
> > having to do an x.encode('latin-1') manually for each string?
>=20
> It is already activated. Please explain *exactly* what you did if you
> want more help.
>=20
> Regards,
> Martin
>=20