Domanda

I have this script included in the body of my html file:

<script>
function read() {
    $.get("prevision.txt", function(data) {
        $('#prev').html(data);
    });
}

$(document).ready(read); </script>

When there is an accent included in the .txt file, the #prev shows: � instead of an accent.

I have all files encoded as UTF-8. How can I solve this?

Thanks

È stato utile?

Soluzione

Use the html codes instead of true characters.

for Ex.

'<' == '&lt;' // true

complete reference for accented chars here

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top