[FX.php List] The Euro sign (€ or € ) in email messages

Erik Andreas Cayré erik at cayre.dk
Sat May 5 05:46:32 MDT 2007


Den 05/05/2007 kl. 13.18 skrev Gjermund Gusland Thorsen:

> Can you look at the headers of your mail receipt?

Sure:

	Fra: 	  php at dagkort.dk
	Emne: 	Dagkort.dk Bestellnummer: 22412
	Dato: 	4. maj 2007 8.36.44 GMT+02:00
	Til: 	  erik.cayre at dagkort.dk
	Svar til:: 	  service at dagkort.dk
	Return-Path: 	<www at mika.avalonia.dk>
	Received: 	from josef.avalonia.dk ([62.243.190.20] verified) by  
elias.avalonia.dk (CommuniGate Pro SMTP 5.1.3) with ESMTP id 10158599  
for erik.cayre at dagkort.dk; Fri, 04 May 2007 08:36:45 +0200
	Received: 	from pasmtpA.tele.dk (pasmtpa.tele.dk [80.160.77.114]) by  
josef.avalonia.dk (Postfix) with ESMTP id B9C069C6B8D for  
<erik.cayre at dagkort.dk>; Fri,  4 May 2007 08:36:45 +0200 (CEST)
	Received: 	from gabriel.avalonia.dk (gabriel.avalonia.dk  
[62.243.190.22]) by pasmtpA.tele.dk (Postfix) with ESMTP id  
A03418000B1 for <erik.cayre at dagkort.dk>; Fri,  4 May 2007 08:36:45  
+0200 (CEST)
	Received: 	from mika.avalonia.dk (mika.avalonia.dk [62.243.190.71])  
by gabriel.avalonia.dk (Postfix) with ESMTP id 1D41077C68 for  
<erik.cayre at dagkort.dk>; Fri,  4 May 2007 08:36:45 +0200 (CEST)
	Received: 	by mika.avalonia.dk (Postfix, from userid 70) id  
BA0521A66FEA; Fri,  4 May 2007 08:36:44 +0200 (CEST)
	Mime-Version: 	1.0
	Content-Type: 	text/plain; charset=ISO-8859-15
	Content-Transfer-Encoding: 	quoted-printable
	X-Mailer: 	PHP/4.3.6
	Message-Id: 	<20070504063644.BA0521A66FEA at mika.avalonia.dk>

// snip

Summe bezahlt: DKK 111,- (¬ 14,89) (inkl. Gebühr: DKK 11,- (¬ 1,48))

// snip




> ggt667
>
> On 5/5/07, Erik Andreas Cayré <erik at cayre.dk> wrote:
>>
>> Den 05/05/2007 kl. 11.34 skrev Gjermund Gusland Thorsen:
>>
>> > I'm not sure if this does exactly the same as you, but I changed  
>> the
>> > principle a bit,
>> > I hope it is more readable...
>> >
>> > function price($dkk, $euro=7.4571) {
>> >       $curr = array(
>> >               ' (&#x20AC;&nbsp;' . number_format ($dkk / $euro,  
>> 2, ',', '.') .
>> > ')',
>> >               'da' => 'DKK&nbsp;',
>> >               ''
>> >       );
>> >       return $curr[$_SESSION['lang']];
>> > }
>>
>> It doesn't, but that's ok. My price function already works just fine
>> as it is (even though it may not be very readable...)
>> The problem remains: the Euro character is fine on the web receipt,
>> but not in the email receipt...
>>
>> > On 5/5/07, Erik Andreas Cayré <erik at cayre.dk> wrote:
>> >>
>> >> Den 04/05/2007 kl. 21.21 skrev Dale Bengston:
>> >>
>> >> > Hi Erik,
>> >> >
>> >> > Sometimes these things can be typeface-specific.
>> >>
>> >> That's right, although in my testcase the Euro sign is present  
>> in the
>> >> typeface used by my mail client.
>> >>
>> >> > Also, what does the character look like in $message, before you
>> >> > decode it? Is it &#xAC; before that?
>> >>
>> >> I'm putting it in there myself with this:
>> >>
>> >> // Return price with appended EURO equivalent, if page viewed  
>> in non-
>> >> danish language
>> >>         function price($dkk, $euro=7.4571) {
>> >>                 $price = (($_SESSION['lang'] == 'da') ?  
>> 'kr.&nbsp;' :
>> >> 'DKK&nbsp;') . $dkk . ',-' . (($_SESSION['lang'] != 'da') ?
>> >> ' (&#x20AC;&nbsp;' . number_format ($dkk / $euro, 2, ',', '.') .
>> >> ')' : '');
>> >>                 return $price;
>> >>         }
>> >>
>> >> /Erik
>> >>
>> >> > Dale
>> >> >
>> >> > On May 4, 2007, at 2:00 PM, Erik Andreas Cayré wrote:
>> >> >
>> >> >> Hi all,
>> >> >>
>> >> >> After the discussion som days ago regarding (un)encoding  
>> text, I
>> >> >> decided to finally try to solve a problem which has been  
>> waiting
>> >> >> for my attention.
>> >> >>
>> >> >> At the end of a completed purchase, the customer is  
>> presented with
>> >> >> a web page receipt, and the script generating it also sends an
>> >> >> email receipt to the customer.
>> >> >>
>> >> >> Reading the docs for html_entity_decode() I decided to try the
>> >> >> charset ISO-8859-15, since it supposedly contains the Euro  
>> sign €
>> >> >> (in case any of you don't know, it's the currency symbol for  
>> the
>> >> >> relatively new common currency now in use in most European
>> >> countries)
>> >> >>
>> >> >> Snippets of my code:
>> >> >> $message2 = html_entity_decode($message, ENT_COMPAT,
>> >> 'ISO-8859-15');
>> >> >>
>> >> >> $mailheaders2 = 'From: dagkort.dk <php at dagkort.dk>' . '
>> >> >> ' .'Reply-To: dagkort.dk <service at dagkort.dk>' . '
>> >> >> ' . 'MIME-Version: 1.0' . '
>> >> >> ' . 'Content-type: text/plain; charset=ISO-8859-15' . '
>> >> >> ' . 'Content-Transfer-Encoding: quoted-printable' . '
>> >> >> ' . 'X-Mailer: PHP/' . phpversion();
>> >> >>
>> >> >> // send testmail receipt
>> >> >>
>> >> >>      mail('erik.cayre at dagkort.dk', $subject, wordwrap
>> >> ($message2, 70),
>> >> >> $mailheaders2);
>> >> >>
>> >> >> The messages sent using the above do not correctly show the  
>> Euro
>> >> >> sign.
>> >> >> Instead I get this '¬' (don't know the name of that  
>> character, but
>> >> >> it's &#xAC; when HTML encoded)
>> >> >>
>> >> >> Does anyone have a solution, or a clue?
>> >> >>
>> >> >>
>> >> >> ---
>> >> >> Erik Andreas Cayré
>> >> >> Spangsbjerg Møllevej 169
>> >> >> DK-6705 Esbjerg Ø
>> >> >>
>> >> >> Home Tel: +45 75150512
>> >> >> Mobile: +45 40161183
>> >> >>
>> >> >> »Interest can produce learning on a scale compared to fear as a
>> >> >> nuclear explosion to a firecracker.«
>> >> >> --Stanley Kubrick
>> >> >>
>> >> >> »If you can't explain it simply, you don't understand it well
>> >> >> enough.«
>> >> >> -- Albert Einstein
>> >> >>
>> >> >> »If you don't have time to do it right, when will you have  
>> time to
>> >> >> do it over?«
>> >> >> -- John Wooden, basketball coach
>> >> >>
>> >> >>
>> >> >> _______________________________________________
>> >> >> FX.php_List mailing list
>> >> >> FX.php_List at mail.iviking.org
>> >> >> http://www.iviking.org/mailman/listinfo/fx.php_list
>> >> >
>> >> > _______________________________________________
>> >> > FX.php_List mailing list
>> >> > FX.php_List at mail.iviking.org
>> >> > http://www.iviking.org/mailman/listinfo/fx.php_list
>> >>
>> >>
>> >>
>> >> ---
>> >> Erik Andreas Cayré
>> >> Spangsbjerg Møllevej 169
>> >> 6705 Esbjerg Ø
>> >>
>> >> Privat Tel: 75150512
>> >> Mobil: 40161183
>> >>
>> >> ---
>> >> »Interesse kan skabe læring på en skala sammenlignet med frygt,  
>> som
>> >> en nuklear eksplosion i forhold til en kineser.«
>> >> --Stanley Kubrick
>> >>
>> >> »Kun p....sure mennesker kan ændre verden. Innovation skabes  
>> ikke af
>> >> 'markedsanalyse', men af folk, der er afsindigt irriterede over
>> >> tingenes tilstand «
>> >> --Tom Peters
>> >>
>> >> »Hvis du ikke kan forklare det simpelt, forstår  du det ikke godt
>> >> nok.«
>> >> -- Albert Einstein
>> >>
>> >> »Hvis du ikke har tid til at gøre det rigtigt, hvornår vil du  
>> så have
>> >> tid til at lave det om?«
>> >> -- John Wooden, basketball coach
>> >>
>> >>
>> >> _______________________________________________
>> >> FX.php_List mailing list
>> >> FX.php_List at mail.iviking.org
>> >> http://www.iviking.org/mailman/listinfo/fx.php_list
>> >>
>> > _______________________________________________
>> > FX.php_List mailing list
>> > FX.php_List at mail.iviking.org
>> > http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>>
>>
>> ---
>> Erik Andreas Cayré
>> Spangsbjerg Møllevej 169
>> 6705 Esbjerg Ø
>>
>> Privat Tel: 75150512
>> Mobil: 40161183
>>
>> ---
>> »Interesse kan skabe læring på en skala sammenlignet med frygt, som
>> en nuklear eksplosion i forhold til en kineser.«
>> --Stanley Kubrick
>>
>> »Kun p....sure mennesker kan ændre verden. Innovation skabes ikke af
>> 'markedsanalyse', men af folk, der er afsindigt irriterede over
>> tingenes tilstand «
>> --Tom Peters
>>
>> »Hvis du ikke kan forklare det simpelt, forstår  du det ikke godt  
>> nok.«
>> -- Albert Einstein
>>
>> »Hvis du ikke har tid til at gøre det rigtigt, hvornår vil du så have
>> tid til at lave det om?«
>> -- John Wooden, basketball coach
>>
>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



---
Erik Andreas Cayré
Spangsbjerg Møllevej 169
6705 Esbjerg Ø

Privat Tel: 75150512
Mobil: 40161183

---
»Interesse kan skabe læring på en skala sammenlignet med frygt, som  
en nuklear eksplosion i forhold til en kineser.«
--Stanley Kubrick

»Kun p....sure mennesker kan ændre verden. Innovation skabes ikke af  
'markedsanalyse', men af folk, der er afsindigt irriterede over  
tingenes tilstand «
--Tom Peters

»Hvis du ikke kan forklare det simpelt, forstår  du det ikke godt nok.«
-- Albert Einstein

»Hvis du ikke har tid til at gøre det rigtigt, hvornår vil du så have  
tid til at lave det om?«
-- John Wooden, basketball coach




More information about the FX.php_List mailing list