I have the following problem. I’m trying to send data using httppost in Android (my code looks like this http://www.androidsnippets.com/executing-a-http-post-request-with-httpclient). The server using php to get data, here is code:
<?php
$fileContents = $_POST["xml"];
$fileHandle = fopen("test.xml", 'w') or die("can't create file");
fprintf($fileHandle, "%s", $fileContents);
fclose($fileHandle);
?>
It works fine, except non ascii characters are messy in file. When I used php script to send data – all non ascii characters were shown exactly as it needed. What should I do?
Something like this should do the trick instead of the urlencodingformentity stuff:
http://www.java-samples.com/showtutorial.php?tutorialid=735
I googled ‘java post utf8’ to help find this potential solution, in case you need to find more details. 🙂