mysql数据库中波斯字符的问题 [英] Persian character's issue in mysql database
本文介绍了mysql数据库中波斯字符的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我将波斯数据插入数据库时,数据将像这样保存:†Ø¯Ø± 50 لیتری
When I insert Persian data to database, data will save like this: †Ø¯Ø± 50 لیتری
但是当我从数据库中读取数据并在网络上回显它们时,就可以了.
But when I read data from database and echo it on the web, they are Ok.
我需要直接读取数据库中的数据. 您有什么解决方案?
I need to read data in my database directly. what is your solution?
MySQL设置:
服务器连接排序规则:UTF8_general_ci
Server connection collation: UTF8_general_ci
HTML文件字符集为utf8.
Html file charset is utf8.
推荐答案
已解决:
正在连接
<?php
$dbLink = mysql_connect($argHost, $argUsername, $argPassword);
mysql_query("SET character_set_results=utf8", $dbLink);
mb_language('uni');
mb_internal_encoding('UTF-8');
mysql_select_db($argDB, $dbLink);
mysql_query("set names 'utf8'",$dbLink);
?>
这篇关于mysql数据库中波斯字符的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文