开发者

Are there repercussions when switching all mysql tables from latin1_swedish_ci to utf8_unicode_ci?

开发者 https://www.devze.com 2023-03-31 00:33 出处:网络
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

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,

  1. Can I convert all of these tables over to utf8_unicode_ci without causing any data corruption.
  2. Is there a copelling reason to do this if swe开发者_JAVA百科edish has been working fine up till this point?
  3. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消