how to send text using form post method when it has special characters
Hello,
I have some text files and they have many special characters.
I need to read the text in each file using
$handle = @fopen($filename, "r")
....
fread($handle, 1024000);
....
$content=urlencode($content);
...
Then, I am sending this to a form using post method using CURL.
Every file that doesn't have special characters is getting submitted without any problem.
However, when there are some special characters like
™
®
©
The form is not getting submitted.
I have tried to use this code :
$search = array("‘", "’", "'", "—", "”", "“", "…", "™", "®", "©");
$content = str_replace($search, "", $content);
But there are many more symbols and characters as i open new files.
So, please help me deal with these special characters.
Or, I think I need to encode these special characters into UTF-8
Please inform me how to do it.
Thank you.
Last edited by student; 11-22-2008 at 02:13 PM..
|