Click to See Complete Forum and Search --> : javascript french chars display problem


a25khan
08-19-2004, 12:57 PM
I have an encoding problem with Javascript to display special characters.
I extract the data from my xml file. I have a function called GetText("LblName") that returns the corresponding string with the label name.
When I do GetText("LblCompany") it returns me Société instead of Société. BUT It does show up right as text on the asp page.
Here is a label from my xml file

<LblCompany>Société</LblCompany>

If i say alert('<%=GetText("LblCompany")%>') then i get special chars.
I have tried a couple of combinations with Server.HtmlEncode, Escape and Unescape functions.

When I apply Escape function to alert(escape("<%=GetText("LblCompany")%>")) it returns me
Soci%26%23233%3Bt....
I am aware that using Unescape would show & and other related chars.

Can someone please tell me how to get this sorted out? I know i am close to the solution but hey I may be wrong!

Thanks

a25khan

a25khan
08-19-2004, 05:38 PM
Hello Everyone,

This is in continuation with my question.
When i do alert('Société') it does appear right on the page. But if it comes from the xml file thats where the encoding creates problem. Can someone please help me on this?

Thank You