Answer the question
In order to leave comments, you need to log in
Encoding flies when page jumps through php?
Actually I'm trying to get a page from professionali.ru, I get rubbish like "ёСЏ РђР"ександр Захаров РњРѕСЃРєРІР°, Р РѕСЃСЃРёСЏ Дмитрий Щел
РєРѓРѓ
<?php<br/>
echo "Сдираем первые 10 страниц с Профессионалов";<br/>
include 'strip_tags_smart.php';<br/>
for ($x=0; $x<2; $x++) {<br/>
$page = file_get_contents ( 'http://www.professionali.ru/~'.$x);<br/>
iconv("UTF-8", "Windows-1251", $page);<br/>
$page = strip_tags ($page);<br/>
$page = strip_tags_smart( stripslashes($page));<br/>
echo $page."<hr/>";<br/>
};<br/>
<br/>
Answer the question
In order to leave comments, you need to log in
This happens because the site from which the download occurs is cp1251 encoding, and the conversion function is used incorrectly - the arguments are mixed up.
Quote from php.net:
string iconv ( string $in_charset , string $out_charset , string $str )
Your source encoding is UTF-8, and the resulting encoding is cp1251. Need the opposite.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question