Help from another programming site, use urlencode() . That does the trick.

On Wed, Nov 11, 2009 at 6:06 PM, mndasher <> wrote:

> I store my content in a MySQL database. The website is using PHP. Data
> fields are encoded so that html tags are using entities; i.e.  <p> =
> &lt;p&gt;  When I query the database I decode the entities, and then
> strip the tags. That works fine. But some entities don't get
> converted. So &nbsp; causes a problem for a cURL message. The message
> is truncated at the ampersand.  So I did a string replace where &nbsp;
> becomes a space.  So that solved one problem. But ampersand is still a
> problem. Neither &amp; or simply & work. The both result in a
> truncated message.  A string replace of &amp; with 'and' seems to
> work. But is kind of weird.
> I have also tried utf8_encode($message) but I don't see any difference
> in the output or the result with the API.
> All of the API help and samples I have seen use a very simple message
> example. I have not seen any help on how to format the actual
> message.  I saw some where that it should be UTF-8. Mostly the
> messages are plain text, but these two characters cause problems. So
> do quotes and single quotes as far as that goes.  If I add slashes the
> slashes come through in the final message.
> Is there any real help for these problems?

Reply via email to