Click here to Skip to main content
15,885,904 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi. I have next problem.
There are files core.js and test.js
There is a function in core.js file, that shows error text.
JavaScript
//core.js
function showError(text) {
    $('#alertPlace').html('<div class="alert alert-danger"><button type="button" class="close" data-dismiss="alert">×</button>' + text + '</div>');
}

somewhere on my page there is an empty div, where the error message should be displayed:
HTML
...
<div id="alertPlace"></div>
...

and in my test.js file i call showError function.
JavaScript
...
showError("Заполните все поля."); //input all fields
...

so, when i want to display russian text, i get ????? (��������� ��� ����) symbols, instead of text. when i display english text, all is fine.

P.S. i include core.js and test.js in my html page. also i set there
HTML
<meta charset="utf-8" />

Any ideas?
Posted

1 solution

Make sure that all your files are utf8. That means, all JS, HTML, and also CSS, everything that is interpreted by the browser. That also means that the dyanimc code generation should be also utf8, as well as the http charset[^]. I would use Notepad++ to check and convert file encoding if needed. Mixing encoding might bring unexpected results.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900