in reply to HTML::Entities and UTF-8

What version of Perl are you using? With Perl 5.6, HTML::Entitites seems to encode the UTF-8 bytes. With Perl 5.8, it encodes Unicode strings properly.
$string = encode_entitites("\x{263A}"); # $string = "☺";

Replies are listed 'Best First'.
Re: Re: HTML::Entities and UTF-8
by amonroy (Scribe) on Apr 14, 2004 at 20:57 UTC

    I'm using version 5.8.0.

    I am sending UTF-8 in the character set parameter of the HTTP header. When I print the $variables as they are, e.g a chinese character, the browser renders them just fine. But if I apply the HTML::Entity encoding then it shows gibbrish.

    Now that I think about it, maybe I should not be sending UTF-8 in the HTTP header when I'm using HTML::Entities.

    Thanks a lot.