Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#5364 closed enhancement (invalid)

Adapting DB to utf8 can be done without loosing non-ascii characters

Reported by: jehon07@… Owned by: Anduin Withers
Priority: major Milestone: 0.22
Component: mythvideo Version: head
Severity: high Keywords: db utf8
Cc: Ticket locked: no


You are adapting DB so that columns become real "utf8" data. Great!

But if you change them directly "alter x modify coly character set utf8", mysql will translate the content (wich is in utf8, but known by mysql as latin1) from latin1 to utf8.

This can be avoided:

  1. Alter x modify coly blob
  2. Alter x modify coly varchar(128) character set utf8

This can add some nasty \0 character at the end, thus a third command can be added:

  1. upgrade x set coly = replace(coly, "\0", "")

This is explained in

Thank you for your great job in mythtv! I hope this small info I give here can help.

Change History (2)

comment:1 Changed 13 years ago by Janne Grunau

Resolution: invalid
Status: newclosed

Thanks, but that's that we are doing except the terminating '\0' replacement. I haven't seen that yet.

Are you sure that the terminating '\0' replacement is necessary?

comment:2 Changed 13 years ago by anonymous

You are right, sorry, I didn't knew the varbinary type...

For the "\0", it did happened once when I made the modification by hand on the title column...

Thanks for your product!

Note: See TracTickets for help on using tickets.