2004-05-16, 00:11
alright.. easier said than done.
i looked into it a bit but haven't had much luck yet. the mythtv database is supposedly using the latin1 character set. when i select values in the database using the mysql client, i see values like:
tã©lã©journal
from that value, the mythweb module gets the following:
téléjournal
so apparently mysql is storing the value correctly... when i retrieve the value in python and print it out, i get the first value - not the second. how do i convert it so that python will output it correctly? i tried using the unicode() function to convert the string but kept getting exceptions that the ordinal is not in range... anyone else figured this out?
edit: it appears that mysql prefixes "special characters" with \xc3 when sending them over the network. i put in a hack for now to strip the character and convert the character after it appropriately and it seems to work for the data i have in my myth database. i'm thinking the proper solution is to change the database to store everything in unicode so that when it is retrieved over the network, everything is sent in unicode. i'm not sure the supporting tools to fill the myth database work with unicode even... so for now this'll have to do until i can confirm the correct way to fix this.
i looked into it a bit but haven't had much luck yet. the mythtv database is supposedly using the latin1 character set. when i select values in the database using the mysql client, i see values like:
tã©lã©journal
from that value, the mythweb module gets the following:
téléjournal
so apparently mysql is storing the value correctly... when i retrieve the value in python and print it out, i get the first value - not the second. how do i convert it so that python will output it correctly? i tried using the unicode() function to convert the string but kept getting exceptions that the ordinal is not in range... anyone else figured this out?
edit: it appears that mysql prefixes "special characters" with \xc3 when sending them over the network. i put in a hack for now to strip the character and convert the character after it appropriately and it seems to work for the data i have in my myth database. i'm thinking the proper solution is to change the database to store everything in unicode so that when it is retrieved over the network, everything is sent in unicode. i'm not sure the supporting tools to fill the myth database work with unicode even... so for now this'll have to do until i can confirm the correct way to fix this.