i have created a english/korean site using i am using struts properties file to do internationalization.
my messages are stored in the format &#xxxx
for example:
text.hello=퍫秿
in my html using
<bean:message key="text.hello"/> displays correctly in my browser.
what i need know is for javascript to be able to show &#xxxxx; , what conversion do i need or anyone has experience with this.
i tried replacing &# with \u and remove ; but to no avail.
alert(fixText('<bean:message key="text.hello"/>'));
will be
alert(fixText('퍫秿'));
and javascript alert output will be just \u54123\u31231 - should be the correct korean characters...
function fixText(theStr){
while(true){
if(theStr.indexOf("&#") >= 0){
theStr = theStr.replace("&#", "\\")
theStr = theStr.replace(";","");
}
else
break;
}
theStr = theStr.replace("<li>","");
theStr = theStr.replace("</li>","");
return theStr;
}
>>>>
is this possible with javascript? if so what do you guys suggest?
please help me out.
many thanks...
my messages are stored in the format &#xxxx
for example:
text.hello=퍫秿
in my html using
<bean:message key="text.hello"/> displays correctly in my browser.
what i need know is for javascript to be able to show &#xxxxx; , what conversion do i need or anyone has experience with this.
i tried replacing &# with \u and remove ; but to no avail.
alert(fixText('<bean:message key="text.hello"/>'));
will be
alert(fixText('퍫秿'));
and javascript alert output will be just \u54123\u31231 - should be the correct korean characters...
function fixText(theStr){
while(true){
if(theStr.indexOf("&#") >= 0){
theStr = theStr.replace("&#", "\\")
theStr = theStr.replace(";","");
}
else
break;
}
theStr = theStr.replace("<li>","");
theStr = theStr.replace("</li>","");
return theStr;
}
>>>>
is this possible with javascript? if so what do you guys suggest?
please help me out.
many thanks...
Comment