Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Special html characters being re-encoded in html! £ being changed to £


Go to End


2 Posts   2252 Views

Avatar
Hammy

Community Member, 49 Posts

22 November 2008 at 11:51pm

Edited: 22/11/2008 11:52pm

I have a list of currency symbols listed in my database that are entered into a text field.

For the Pound Symbol £ - I am entering £, however when I then try and use this in a template, the ampersand - &, is being encoded again as &. So this displays the symbol incorrectly as &pound on the page (or £ in the html source code) rather than £.

Is there a way to stop this from re-encoding in the template?

Avatar
Hammy

Community Member, 49 Posts

23 November 2008 at 9:21am

Found the solution on the following page:
http://api.silverstripe.com/sapphire/model/Text.html

When inserting content into a template and to avoid special characters from being re encoded - use .NoHTML

Ie $ContentType.NoHTML - simple :)