English 中文(简体)
PHP从QSERVER获得阿拉伯文内容
原标题:PHP get Arabic Content from SQL SERVER

在我管理<代码>时,我怎么能获取阿拉伯文内容。 MSSQL_questRY ?

它是作为<条码>吗?

$res = mssql_query($q);
$row = mssql_fetch_row($res)
echo iconv("unicode", "utf-8", $row[0])

但在本案中,它显示中国字母的数值为>>。

该建议受到高度赞赏。

最佳回答

仅使用统法协会编码数据类型。 统法协会的数据类型为:Nchar、Nvarchar、Nvarchar(max)和Ntext,你必须先从统法协会的所有编码中提取一封信N。

INSERT INTO TableName (ColumnName) values(N Arabic Text )
问题回答

最好在你选择阿拉伯文本之前尝试将这一数据输入数据库:

SET NAMES utf8;

例如,在使用PDO时:

try {           
    $dbh = new PDO(
     mysql:host=127.0.0.1;dbname=dbname ,
     root ,
     root ,
    array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")
);
} catch (Exception $e) {
    echo $e->getMessage();
}

第二,确保通过UTF-8编码保存你们的所有档案(PHP文档、超文本模板)。

第三,如果所有失败者都试图与iconv()一道发挥更大作用:

echo iconv("Latin1_General_CI_AS","utf-8",$row[0]);
echo iconv("Arabic_CI_AS","utf-8",$row[0]);

因此。





相关问题
Export tables from SQL Server to be imported to Oracle 10g

I m trying to export some tables from SQL Server 2005 and then create those tables and populate them in Oracle. I have about 10 tables, varying from 4 columns up to 25. I m not using any constraints/...

SQL server: Can NT accounts be mapped to SQL server accounts

In our database we have an SQL server account that has the correct roles to access some of the databases. We are now switching to windows authentication and I was wondering if we can create a NT user ...

SQL Server 2000, ADO 2.8, VB6

How to determine if a Transaction is active i.e. before issuing Begin Transaction I want to ensure that no previous transaction are open.. the platform is VB6, MS-SQL Server 2000 and ADO 2.8