我有以下问题。我正在尝试在 Android 中使用 httppost 发送数据(我的代码看起来像这样http://www.androidsnippets.com/executing-a-http-post-request-with-httpclient)。服务器使用php获取数据,代码如下:
<?php
$fileContents = $_POST["xml"];
$fileHandle = fopen("test.xml", 'w') or die("can't create file");
fprintf($fileHandle, "%s", $fileContents);
fclose($fileHandle);
?>
它工作正常,除了文件中的非 ascii 字符很乱。当我使用 php 脚本发送数据时 - 所有非 ascii 字符都完全按照需要显示。我该怎么办?