Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The string "ďťż" appears on my page randomly but only in firefox. IE and chrome don't have this problem.

Nothing actually prints that anywhere in my code. So far i've found it in only two places one of them being:

<li class="spatiu"> </li>
<li class="memento_li"> 
    <div id="afisare_alerte">
    <script language="javascript">
        afisare_alerte_php();
    </script>
</div> 
</li>';

and this is "afisare_alerte_php()"

xmlhttp_alerte.onreadystatechange=function() {
    if (xmlhttp_alerte.readyState == 4) {                                               
         if(document.getElementById("afisare_alerte").innerHTML=xmlhttp_alerte.responseText){
         }
         schimbare_tip_cursor('default');
    }
    else{
        schimbare_tip_cursor('progress');
    }
};

well the ajax part of it.

the file it loads is

<?php
    echo'
    0 Notificari
';
?>

and the output :

ďťż 0 Notificari
like image 451
Bogdan Avatar asked Sep 28 '11 06:09

Bogdan


1 Answers

That sequence ďťż is called the Windows Byte Order Mark. It shows up whenever you save a file as UTF in most Windows programs. So the problem here is that you must be serving that ajax endpoint from a Windows server, and the server is configured to output a BOM. How to fix this depends on what web server you are using.

like image 86
Ben Lee Avatar answered Sep 30 '22 06:09

Ben Lee