You need to sign in to do that
Don't have an account?
Sunil Wadeyar 4
HTMLENCODE function returns ' for apostrophe in visualforce pages
Hi,
In my Visualforce Page I have few labels where I'm using {!HTMLENCODE($Label.SomeText)}. In French Langauage there are some strings which contain apostrophe and it's rendering as ' .
I tried JSENCODE as wll it shows "\'"(backslash followed by apostrophe)
In my Visualforce Page I have few labels where I'm using {!HTMLENCODE($Label.SomeText)}. In French Langauage there are some strings which contain apostrophe and it's rendering as ' .
I tried JSENCODE as wll it shows "\'"(backslash followed by apostrophe)
The simplest approach would probably be to encapsulate it in double quotes so that you don't need to worry about escaping a string with single quotes in it.
"{!(Label.SomeText)}"
Please accept my solution as Best Answer if my reply was helpful. It will make it available for other as the proper solution. If you felt I went above and beyond, you can give me kudos.
Thanks and Regards
Sandhya