Re: Storing HTML: HTML entities being rendered in that raw form

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: linnewbie <linnewbie(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Storing HTML: HTML entities being rendered in that raw form
Date: 2009-04-09 16:59:35
Message-ID: 49DE2977.2060005@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 09/04/2009 17:27, linnewbie wrote:

> I have stored HTML in a text field that I subsequently render on the
> web. However when I retrieve and render this data on the web I am
> getting the entities being rendered in their raw form, ie, instead of
> getting the '&' symbol when '&amp;' is stored I'm getting the 'raw'
> '&amp;'.

Can you show us how you're storing the HTML? If you're sending the
ampersands into the database as '&amp;', then that's what's going to get
stored, and so that's what you're going to get back. Postgres doesn't
change '&amp;' -> '&', you'll need to do that yourself before sending it
to the database.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Steve Atkins 2009-04-09 17:00:47 Re: Storing HTML: HTML entities being rendered in that raw form
Previous Message Raymond O'Donnell 2009-04-09 16:56:57 Re: ON condition in LEFT OUTER JOIN doesn't work?!