You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by gilles <mi...@wanadoo.fr> on 2002/11/25 16:19:47 UTC

mp2: Pb using HTML::Entities

I write in my handler something like  :

use HTML::Entities;
...
 $r->content_type('text/html;charset=iso-8859-1')
my $txt="Long life to the &curren";
&decode_entities($txt)
$r->print ($txt);
return Apache::OK;

I get in my navigator : "Long life to the ." (where . is a symbol 
different from euro symbol).

It seems that Entities dont work with modperl2, but I am sure that's the 
mistake is on my side!
Can somebody tell me the good way of using Entities with mp2.

Thank you.







Re: mp2: Pb using HTML::Entities

Posted by Steve Piner <st...@marketview.co.nz>.

gilles wrote:
> 
> I write in my handler something like  :
> 
> use HTML::Entities;
> ...
>  $r->content_type('text/html;charset=iso-8859-1')
> my $txt="Long life to the &curren";
> &decode_entities($txt)
> $r->print ($txt);
> return Apache::OK;
> 
> I get in my navigator : "Long life to the ." (where . is a symbol
> different from euro symbol).

If the character you're getting is a circle with 4 'spokes' extending
from it to the top left, top right, bottom left and bottom right, then
it's working - however, that's the universal currency symbol.

For the euro, use &euro; or &#8364;


Steve

-- 
Steve Piner
Web Applications Developer
Marketview Limited
http://www.marketview.co.nz

Re: mp2: Pb using HTML::Entities

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

gilles wrote:
> I write in my handler something like  :
> 
> use HTML::Entities;
> ...
> $r->content_type('text/html;charset=iso-8859-1')
> my $txt="Long life to the &curren";
> &decode_entities($txt)

I think you want encode_entities() here :)

HTH

--Geoff