MySQL db(utf-8)中的克罗地亚变音符号 [英] Croatian diacritic signs in MySQL db (utf-8)

查看:92
本文介绍了MySQL db(utf-8)中的克罗地亚变音符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

发音符号http://img98.imageshack.us/img98/3383/dijakritickiznakovi .gif

因此,显示标题下方的符号应以这种方式显示.
UTF-8实体列在HTML(utf-8)标题下方(此处为列表: LINK )
最后一行显示存储在我的数据库中的内容.
db表的排序规则是utf8_unicode_ci.
我想db中的符号不​​应该与我的情况相同吗? 从数据库加载时,它们在页面上正确显示,但是从给定链接的utf-8表中都不会显示它们.即使我正确地看到了它们,也许其他人也不会?

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?

推荐答案

设置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.

我已经将斯洛文尼亚文字存储到MySQL已有一段时间了,这对我来说是有效的:

I've been storing slovenian text into MySQL for some time now and this is what works for me:

  • the first thing you do after connecting should be to issue a "SET NAMES utf8" query
  • make sure that the strings you're storing are utf-8 to start with: if you're taking them from a web page form make sure the page is UTF-8
  • be careful what tools do you use to browse/edit the database contents online: PhpMysqlAdmin is definitely unsafe.

希望这会有所帮助.

这篇关于MySQL db(utf-8)中的克罗地亚变音符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆