Click here to Skip to main content
15,920,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I am using following code to receive data from a client PC. Then I am saving it in a text file. It is working for English. But, from server if I am sending NLS languages(Like Russians, or french), this files are showing garbage;

Working fine: English
Not working: Russian

PHP
$body = file_get_contents('php://input');
$today = date("dmY-Gis");
$name = $today . ".log";
//$FilePath = $HostFolder . "\\" . $name;
	
$f = fopen($name, "w+");
fwrite($f, utf8_encode($body));
fclose($f);


Can any one send me any clue?? Is it required to save open and create file in Unicode format?

Thanks
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900