[FX.php List] Trying to send email with lots of accented letters

Kevin Futter kfutter at sbc.melb.catholic.edu.au
Mon Aug 13 20:23:36 MDT 2007


On 14/8/07 12:09 PM, "Nick" <whatdoyouwant at gmail.com> wrote:

> well, http://www.php.net/html_entity_decode might be a place to start looking.
> either that or str_replace the &amp; to &?  It really depends on your data, as
> well as how much you trust your data..
> 
> your main problem is the &amp;#233; needs to be just &#233; (without the
> "amp;" ) to display on the page as é.
> 
> On 8/13/07, Bob Patin <bob at patin.com> wrote:
>> I have a French client who's asked me to write a script for sending an email
>> containing the results of various queries. So far so good...
>> 
>> Except that when a word has accented letters, it comes out like this:
>> 
>> Tache: Rough &amp;#233;lectricit&amp;#233; (confirm&amp;#233;)
>> 
>> ... instead of looking like this:
>> 
>> Tache: Rough Rough électricité (confirmé)
>> 
>> I've already put the following META tag into the page that assembles the
>> email text
>> 
>> <meta http-equiv="content-type" content="text/html; charset=UTF-8">
>> 
>> ... but I'm getting that ugly text above.
>> 
>> Is there a PHP command that would fix this, or should I look elsewhere?
>> 
FileMaker appears to HTML encode non-ASCII output via the XML interface by
default. This should be fine by itself, but if you¹re parsing your data with
htmlentities (or str_replace) or similar, it will take the ampersand (HTML
entities escape character) and encode it as ³&amp;² (without quotes). This
appears to be what¹s happening in your case. You¹ll probably have to avoid
htmlentities in this case.

One other tip ­ if you¹re using str_replace to manually find Œ&¹ and replace
with Œ&amp;¹, in order to avoid the above problem search for Œ& Œ (note the
trailing space) and replace with Œ&amp; Œ. This will skip any ampersand that
actually is being used as an entity escape sequence.


-- 
Kevin Futter
Webmaster, St. Bernard's College
http://www.sbc.melb.catholic.edu.au/


#####################################################################################
This e-mail message has been scanned for Viruses and Content and cleared 
by MailMarshal
#####################################################################################

This e-mail and any attachments may be confidential. You must not disclose or use the information in this e-mail if you are not the intended recipient. If you have received this e-mail in error, please notify us immediately and delete the e-mail and all copies. The College does not guarantee that this e-mail is virus or error free.  The attached files are provided and may only be used on the basis that the user assumes all responsibility for any loss, damage or consequence resulting directly or indirectly from the use of the attached files, whether caused by the negligence of the sender or not. The content and opinions in this e-mail are not necessarily those of the College.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20070814/6b152e30/attachment.html


More information about the FX.php_List mailing list