function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sunil Wadeyar 4Sunil 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)
SandhyaSandhya (Salesforce Developers) 
Hi Sunil Wadeyar,

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