Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Aug : Problem with Ampersand in text string

www.cryer.info
Managed Newsgroup Archive

Problem with Ampersand in text string

Subject:Problem with Ampersand in text string
Posted by:"David Fealkoff" (fealko..@iatinc.net)
Date:Thu, 2 Aug 2007 12:37:35

I'm sending text strings embedded in an XML format using HTTP Client.  The
code looks something like this:

strlist := TStringList.Create;
textstring := '<text>pies & video</text>';
strlist.Values['XML'] := textstring;

IdHTTP.Post(URL, strlist);

On the server side I retrieve
ARequestInfo.Params.Value['XML'] but it truncates everything after the &
(pies but no video) and causes and error.  At first I thought it might be an
XML problem, before looking too closely at it, and replaced the ampersand
'&' with '&amp;' but that didn't help.

So it appears that either the Indy Client or the Indy Server reads the '&'
as the start of a new parameter.

How do I work around this?

Thanks.

David

Replies:

www.cryer.info
Managed Newsgroup Archive