Re: UTF8 under Perl 5.6.1

Grant McLean <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.petal
Message-ID <1109445246.4239.10.camel@localhost>
On Sat, 2005-02-26 at 07:58 -0500, William McKee wrote:
> Can someone tell me if UTF8 works reliably under Perl 5.6.1? My initial
> experience is that it doesn't (I get the white question mark inside a
> diamond character instead of nbsp chars). Changing the output header
> back to iso8859-1 made those go away. What is the recommned output
> header when using Petal 2+ under Perl 5.6.1?

The UTF8 implementation in 5.6 is not great, but it certainly does work
for simple cases like the one you quote.

The recommended approach is to include a meta-equiv tag in your HTML
head:

  <meta http-equiv="content-type" content="text/html; charset=utf-8">

and also set the content type HTTP header:

  Content-type: text/html; charset=utf-8

If you don't specify the charset in the HTTP, Apache typically sets it
to 'iso-8859-1'.  I think there's an RFC somewhere that says the HTTP
header trumps the meta tag.

Regards
Grant
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.