[mythtv-users] Database update schema error with trunk utf8
Michael T. Dean
mtdean at thirdcontact.com
Wed Dec 17 20:33:14 UTC 2008
On 12/17/2008 09:03 AM, Janne Grunau wrote:
> On Wednesday 17 December 2008 06:02:09 Michael T. Dean wrote:
>> The default character set for the server shouldn't have any effect on Myth
>> as the proper charset for the mythconverg database will be specified by
>> mc.sql when the database is created
> Unfortunately not. MythTV sents UTF-8 encoded data over a UTF-8 connection
> but the database charset is latin-1. The server converts now the UTF-8
> encoded data to latin-1 and stores it in the table.
Ah, right. I didn't realize that if configured such that the server
default character set is utf8, then /all/ clients would get UTF-8
connections unless they specifically ask otherwise. I had assumed that
the database (here, mythconverg) default character set would mean
clients get connections using the database default character set. In
fact, my assumption is true /only/ if there is no specified server
default character set (as on my system). So, the distro's specifying a
server default character set has made a mess...
> So the database should hold plain latin-1 strings instead of utf-8 in
> latin-1 and the conversion will fail.
Yep. I can now reproduce the issue (the key was understanding the
mysqldump for MySQL 5 and above, at least, always does UTF-8 format
dumps--even if a server default character set is specified--unless
specifically told otherwise). So, when I restored the backup data
freedenizen sent me with a UTF-8 connection, I got data exactly as it's
stored in his DB and got the exact same failure he got.
More information about the mythtv-users