[Baypiggies] Handling unwanted Unicode \u2019 characters in XML

Stephen McInerney spmcinerney at hotmail.com
Wed Jul 2 03:37:33 CEST 2008



> > I don't get that, I get this: 'â' (does it depend on C locale settings? if
> > so, that's not very satisfactory at all):
> >>>> print u'\u2019'.encode('utf-8')
> > â
> 
> Hmmm, what are the results of these set of commands?
> 
> $ python
> Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
> >>> import locale
> >>> locale.getdefaultlocale()
> ('en_US', 'UTF8')
> >>> print u'\u2019'
> '
> >>> print u'\u00E2'
> â

For me, it's:
>>> import locale
>>> locale.getdefaultlocale()
('en_US', 'ISO8859-1')

But should I be changing setdefaultlocale() ?


_________________________________________________________________
Use video conversation to talk face-to-face with Windows Live Messenger.
http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_video_072008
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20080701/1fd59beb/attachment.htm>


More information about the Baypiggies mailing list