0

我正在开发的闪存页面有问题。它通过 php 文件向数据库发送请求并检索我放置在文本字段中的文本。问题是瑞典语和其他特殊字符以类似于 \u00e4 的代码格式显示。我知道我的 php 文件和数据库都是正确的,因为我在 android 应用程序中使用了相同的请求和相同的 php 文件和数据库,并且它运行良好。

有谁知道cs3中的flash actionscript 3.0中是否有某种代码作为utf-8或类似函数。

<?php 
header("Content-type: text/html; charset=utf-8"); 

$con = mysql_connect("localhost","db","psw");
if(!$con)
{
die(' not working: ' . mysql_error());
}
mysql_select_db("dbname", $con);
mysql_set_charset('utf8');

if($_REQUEST['sort']=='categories'&&$_REQUEST['prg']=='flash')
{
$q=mysql_query("SELECT * FROM ".$_REQUEST['sort']." ORDER BY id");
while($e=mysql_fetch_assoc($q)) //assoc
     $output[]=$e;
echo $output;
}

mysql_close();
?>

感谢您的帮助/米克

4

1 回答 1

0

在发送它之前尝试对您的字符串进行简单的 escape()。

escape("\u00e4"); // returns %20%E4, which php should interpret as "ä"

可能需要在 phpurldecode()中。

于 2011-11-03T04:35:03.757 回答