Hello World,
I've an Encoding problem that I can't deal with, I think I tried almost everything possible.
Let's consider this simple function, which basically download the content of a webpage:
public static string FileGetContentsURL(string url)
{ return new WebClient().DownloadString(url); }
Now call it this way, to make sure accents are well understood:
FileGetContentsURL("http://www.myserver.com/test.php?text="+HttpUtility.UrlEncode("#�©�¨� "));
Where test.php is a simple php script that write the $_GET["text"] to a file:
<?
file_put_contents("test.txt","GET=".$_GET["text"]."\n");
?>
Whatever I do, I never get "#�©�¨� " in my file:
#cat test.txt
GET=#Ã?Æ?Ã?©Ã?Æ?Ã?¨Ã?Æ? @
Of course it's an encoding problem, the get seems to send an UTF8 string while the server interpret it as an ...
Go to the complete details ...