I was working with file_get_contents() with urls containing special characters. i picked some urls from wikipedia for checking.
my "test1.php"
<?php
header('Content-Type: text/html; charset=UTF-8');
echo file_get_contents($_GET['url']);
?>
urls i tested:(note: the special characters are not properly displayed in these links..click on the link to see the special char at the address bar)
http://localhost/te/test1.php?url=http://en.wikipedia.org/wiki/T%C3%A2i-l%C3%B4
---- THE ABOVE URL WORKED and display the contents but BELOW DOESN'T WORK ------
http://localhost/te/test1.php?url=http://en.wikipedia.org/wiki/Pha%CC%8Dk-oa-chhi_romanization
localhost/te/test1.php?url=http://en.wikipedia.org/wiki/Bb%C3%A1nl%C3%A1m_H%C5%8Dngggi%C3%A1n_P%C4%ABny%C4%ABn_H%C5%8Dng%C3%A0n
I tried mb_convert_encoding() but it didnt solve... Help me to solve this.Thanks in adv.
for that I believe you have to use . urlencode($variable);