In general, such a thing, there is a website encoded in windows-1251 and a base encoded in utf-8, the server successfully recodes everything in windows-1251, but Arabic text in names and surnames began to appear in the database, and the name is displayed on the site after recoding ????????? ????????? I had 2 options for solving this problem
- Display names and surnames by frame where iframe is in another encoding (utf-8)
- Make ajax request and change data after page load
I think there is a more elegant solution can someone tell me
ps: You cannot completely change the encoding in the database or on the site
a little later a solution was found, but I also do not consider it ideal
<meta charset="windows-1251"> <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <script> $(function(){ var tmp = decodeURIComponent($('div').html()); console.log(tmp); $('.test').html(tmp); }) </script> <?php $textw = 'text ัะตะบัั windows'; $textw = iconv('UTF-8',"windows-1251//TRANSLIT",$textw); $text = urlencode ('DIMA IVANOV dima ivanov ุจูุณูู
ู ุงููููู ุงูุฑููุญูู
ูู ุงูุฑููุญููู
ู'); echo $textw .'<div>'. $text.'</div><div class="test"></div>';
iconv? - Mr. Black"SET NAMES 'cp1251'", for phpmb_internal_encoding('cp1251');and also specify the encoding in the headerheader('Content-type: text/html; charset=windows-1251');Maybe some of this will help. I have not encountered such problems yet, I have a base and website in 1251, scripts in utf8 and no problems - Mr. Black