UTF8 with alert of Javascript

Hello

I get some value "Russia" from my file RessourceBundle
and I have a UTF8 string following

<script language='javascript'>
var MSG_INVALID = "&#1042;&#1099; &#1074;&#1074;&#1077;&#1083;&#1080; &#1085;&#1077;&#1087;&#1088;&#1072;&#1074;&#1080;&#1083;&#1100;&#1085;&#1099;&#1077; &#1089;&#1080;&#1084;&#1074;&#1086;&#1083;&#1099; &#1074; %0.\n&#1042;&#1074;&#1077;&#1076;&#1080;&#1090;&#1077; &#1076;&#1088;&#1091;&#1075;&#1080;&#1077; &#1089;&#1080;&#1084;&#1074;&#1086;&#1083;&#1099;"
</script>

when I alert : alert(MSG_INVALID), it don't display like unicode
I know we can use
  alert(String.fromCharCode(1042,1099,1074,1074, ......));
or we can use the hidden input of form to stock this value
but I dont know there are another solutions for this?

thanks a lot
best regards
ndhaiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michel PlungjanIT ExpertCommented:
Or a hidden div, which is what I would use if no-one has a good solution

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <title>Untitled</title>
<script>
function alertIt(replacement) {
  var x = document.getElementById('rusmsg').innerHTML;
  x=x.replace('%0',replacement).replace('\\n','\n')
  alert(x)
}  
</script>
</head>

<body onLoad="alertIt('Error 3')">
<div id ="rusmsg" style="display:none">&#1042;&#1099; &#1074;&#1074;&#1077;&#1083;&#1080; &#1085;&#1077;&#1087;&#1088;&#1072;&#1074;&#1080;&#1083;&#1100;&#1085;&#1099;&#1077; &#1089;&#1080;&#1084;&#1074;&#1086;&#1083;&#1099; &#1074; %0.\n&#1042;&#1074;&#1077;&#1076;&#1080;&#1090;&#1077; &#1076;&#1088;&#1091;&#1075;&#1080;&#1077; &#1089;&#1080;&#1084;&#1074;&#1086;&#1083;&#1099;</div>


</body>
</html>
0
ndhaiAuthor Commented:
thanks for your reponse but it likes my method
i think we haven't no choice with String.fromCharCode
admin, could you close this question ?
thanks
ndhai
0
Michel PlungjanIT ExpertCommented:
Please ask here http://www.experts-exchange.com/Community_Support/ for a paq/refund
0
GranModCommented:
Closed, 80 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.