Special Chars in Javascript (jQuery)
I'm developing a web app in asp.net mvc using jquery, the language of application is pt-BR and开发者_运维技巧 some characteres are not displayed correctly, like accented charcacters and 'ç' char. Insted of this, a unknown char is displayed on browser.
Is there any way to set the location on jquery ? Or on the file .js, .aspx?
I am not doing an ajax call, I'm writing a text in elements of html like div, hyperlink, etc... something like this:
$("#myDiv").text("Água, Açúcar, e leite em pó");
But in my div is shown: "?gua, A??car, e leite em p?"
I've set my globalization in web.config to pt-br, my html tag and meta tags to pt-br:
<!DOCTYPE html>
<html lang="pt">
<head>
<title>...</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="content-language" content="pt-br">
Is there anything is missing ?
Thanks
Educated guess: You are writing the text in ISO-8859-1.
Try forcing the browser to display the page in ISO-8859-1. If the text shows up fine then, this is the reason.
Change the encoding of the file you are fetching the text from. You should have a setting for that in your IDE / text editor.
精彩评论