weird characters when printing in textarea

2

I can not print the characters correctly. if I write anything inside the html, the characters are normal.   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  • If I write a text with special characters in javascript and have it printed in a textarea: "Indication" , this ends up returning in textarea Indicação

    document.getElementById('textarea').value = "Indicação";
    

Is there any way to start this right? the only way to start "right" is by doing what the guy on this blog said? link

    
asked by anonymous 09.04.2015 / 17:48

1 answer

0

John, the problem is that the charsets of your files are incompatible.

I do not know the editor you are using, but to avoid problems, you should save all files with the same charset, preferably UTF-8.

And to ensure compatibility with the browser, I still use the <meta charset="utf-8" /> tag shortly after <head> in my html file.

You can use Notepad ++ [ link to check the charset of your files and even convert. ("Format" menu).

    
10.04.2015 / 23:26