我需要更改桌面上的字符集以支持它所设置的多语言。
latin1_swedish_ci
我需要将其更改为。
utf8mb4_unicode_ci
通过运行此查询很容易做到。
alter table articles convert to character set utf8mb4 collate utf8mb4_unicode_ci;
但我一直在我的本地版本上运行一些测试,在转换之前导出内容,然后在转换之后,然后对这两个文件运行差异检查。
diff articles_before.sql articles_after_charset_change.sql
我预计数据不会真正改变,但我有一大堆差异,主要是反斜杠。
例如
latin1_swedish_ci title。
Coral Beach Resort ??????, Women Dive\'s Day 2017 _ SONY
utf8mb4_unicode_ci title
Coral Beach Resort ??????, Women Dive''s Day 2017 _ SONY
另一个例子 latin1_swedish_ci title。
Studios\\\' Black Panther
utf8mb4_unicode_ci title
Studios\\'' Black Panther
问题主要是反斜杠和引号。
有什么方法可以更改未来数据的字符集,但不能更改任何当前数据?
由于