Are there repercussions when switching all mysql tables from latin1_swedish_ci to utf8_unicode_ci?
We currently have about 30 tables that are using latin1_sweedish_ci for their encodings. I realize though that utf8_unicode_ci is a much safer encoding to use, for which I would like to convert all of these tables over to.
My questions are,
- Can I convert all of these tables over to utf8_unicode_ci without causing any data corruption.
- Is there a copelling reason to do this if swe开发者_JAVA百科edish has been working fine up till this point?
- Is it okay to start using utf8_unicode_ci on newly created tables?
Can I convert all of these tables over to utf8_unicode_ci without causing any data corruption.
If you are working with pure mySQL (i.e. you have no web application actually using the tables), this is likely going to be fine. Switching table collations will convert the data as long as this is possible (it would not necessarily be if converting the other way round, from UTF-8 to latin1, because UTF-8's range is much broader and has many characters that latin1 can't display).
If one or more applications are accessing the tables, it wil all depend on them and whether they can fully deal with UTF-8 data. Many PHP applications, for example, can't.
精彩评论