在mysql数据库中存储瑞典语字符 [英] Storing swedish characters in mysql database

查看:87
本文介绍了在mysql数据库中存储瑞典语字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在将MySQL数据库中存储瑞典语字符时遇到问题.我想使用归类utf8-bin将它们存储在名为users的表中.即使我使用的是utf8,字符å ä ö也存储为Ã¥ ä ö,我不知道为什么.检索数据并回显它会给我相同的输出,但使用奇怪的字符而不是å ä ö.感谢您的帮助.

I'm having problems storing Swedish characters in my MySQL database. I want to store them in my table called users with the collation utf8-bin. Even though I'm using utf8, the characters å ä ö gets stored as Ã¥ ä ö and I don't know why. Retrieving the data and echoing it gives me the same output, with the weird characters instead of å ä ö. Any help is appreciated.

推荐答案

致电

mysql_set_charset("utf8");

连接后且进行任何查询之前.

After connecting and before making any queries.

您的数据库字符集仅用于存储,而不用于应用程序和数据库之间的传输.

Your database charset is just for storage, not for transmission between app and database.

这篇关于在mysql数据库中存储瑞典语字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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