+ Start a Discussion
Nick KeehanNick Keehan 

apex:inputTextarea Displaying Html Symbols

Hi Guys.

I have an Input Text Area which is diplaying HTML URL Encoding References.

As this field is looking at a Input text area field on an object, the object is saved correctly without the codes however this page displays with the symbols. Any idea how to remove them? 

User-added image



Looks like the text that you are trying to store is not being unscaped before it is being displayed in the <apex:inputTextArea>. Use the unescapeHtml4() the of the String class provided in Apex, to escape the Html components and then pass it over to Visualforce for display.

Refer the following Apex code on how you can leverage unescapeHtml4() to resolve your issue.
String s1 = 'Doesn&#39;t want to deal.';
System.debug('Original String -> ' + s1);
System.debug('Escaped String -> ' + s1.unescapeHtml4());
Please do not forget to mark this thread as SOLVED and answer as the BEST ANSWER if it helps resolve your issue.