gpt4 book ai didi

mysql - 哪些字符可以用 UTF 8 表示但不能用 Latin1 表示?

转载 作者:行者123 更新时间:2023-11-28 23:56:05 24 4
gpt4 key购买 nike

我有一个 latin1 表 (latin1_swedish_ci),它非常适合像“SÉRIE TÉLÉVISÉE”这样的字符串 - 但是当我使用像“ẼFINI”这样的字符串时,它会将第一个字符更改为 .现在这最终起作用了(它显示为“Ẽ”)但我只是好奇其他角色会得到这种待遇吗?

影响是由于使用了额外的字符,我的字符串空间不足,所以这个问题不完全是学术性的。我正在考虑使用 UTF8,即

ALTER TABLE description CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

最佳答案

我没有在 Latin1 中占用 1 个字节但在 UTF-8 中占用多个字节的特定字符列表,但这里有一个很好的说明“问题不仅仅是学术问题”:

When to use utf-8 and when to use latin1 in MySQL?

enter image description here

强烈建议:尽可能使用 UTF-8。

附录:

正如 Tim Biegeleisen 上面所说:

@ScottWilson You can look this up on a site like WikiPedia. But even if you convince yourself that you are safe now with only Latin1, how could you be certain that you would not have a problem later on with new data? I'd bite the bullet now, but that's just my choice.

关于mysql - 哪些字符可以用 UTF 8 表示但不能用 Latin1 表示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31643612/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com