MySQL 数据库中的克罗地亚变音符号 (utf-8)
变音符号 http://img98.imageshack.us/img98/3383/dijakritickiznakovi.gif< /a>
因此,显示标题下面的符号应该以这种方式显示。
UTF-8 实体列在 HTML (utf-8) 标题下方(以下是列表:LINK )
最后一行显示了我的数据库中存储的内容。
数据库表的排序规则为utf8_unicode_ci
。
我想 db 中的符号不应该像我的情况那样? 从数据库加载时,它们在页面上正确显示,但它们都没有通过给定链接的 utf-8 表显示。即使我正确地看到它们,也许其他人也不会?
Diacritic signs http://img98.imageshack.us/img98/3383/dijakritickiznakovi.gif
So, symbols belows display title should be displayed that way.
UTF-8 entities are listed below HTML (utf-8) title (here is list: LINK)
And last line shows what is stored in my database.
Collation of db table is utf8_unicode_ci
.
I suppose that symbols in db shouldn't be as they are in my case?
They are displaying correctly on page when loaded from database, but they all of them are not displayed by utf-8 table from given link. Even if I see them correctly maybe someone other won't?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
设置 MySQL 表字符集是不够的 - 您还应该注意为客户端、连接和结果设置正确的字符集,默认值可能因服务器而异,从而使您的数据库不太可移植:相同的数据库内容可能是移动到另一台服务器时显示不同。
我已经将斯洛文尼亚文本存储到 MySQL 一段时间了,这对我有用:
希望这有帮助。
Setting the MySQL table charset is not enough - you should also take care to set the correct charset for the client, the connection and the results, which defaults may differ from server to server making your database less than portable: the same database content might be displayed differently moving to another server.
I've been storing slovenian text into MySQL for some time now and this is what works for me:
Hope this helps.
您似乎正在尝试在数据库中存储 HTML 编码的字符串。不要这样做,它只会破坏您执行可靠搜索等字符串操作的能力。您应该能够将原始 UTF-8 编码字符作为字节存储在数据库中。
您没有说明您使用什么环境来读取数据库,也没有说明如何在底部获取“不正确”字符串(这是使用 ISO-8859-1 编码读取的 UTF-8 字节)。如果它们出现在您的网页中(并且您在标头和/或
标记中指定 UTF-8),那么您大概就在那里。
You appear to be trying to store HTML-encoded strings in your database. Don't do that, it will only break your ability to do string operations like searching reliably. You should be able to store raw UTF-8 encoded characters as bytes in your database.
You don't say what environment you're using to read the database or how you get the ‘incorrect’ string at the bottom (which is UTF-8 bytes read using ISO-8859-1 encoding). If they appear in your web page (and you're specifying UTF-8 in the headers and/or
<meta>
tag), you're presumably pretty much there.