"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> Hi Diez...
>
> Thanks for responding! I'm not really at liberty to share the code,
> but I'll try and make up a test case that shows this if you can't help
> with this extra piece of information which I should have included
> originally (sorry).
>
> Ren\xe9 comes straight out of mysql through sqlobject and then into
> Genshi. It's not a string literal in my python code. Therefore I
> can't just put a u in front of the string.
>
> Any more ideas?
If you're sure you're getting Unicode back from the database -- it
doesn't look like it, since 0xe9 is not the UTF-8 for "é" or "è" -- you
can make something like:
column = unicode(column, 'utf-8')
if it is ISO-8859-1
column = unicode(column, 'iso-8859-1')
and so on for other encodings (such as cp-850, wincp-1225, etc.).
Be sure to use the "fixes" that (ARGH!) MySQL requires to be sure that
it is working with Unicode.
Just to be sure of the encoding in UTF-8:
>>> repr('é')
"'\\xc3\\xa9'"
>>> repr('è')
"'\\xc3\\xa8'"
>>>
Genshi works perfectly with Unicode when it gets it.
Be seeing you,
--
Jorge Godoy <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---