perl-unicode

Re: Creating a UTF-8 web page

2004-04-08 05:30:05
I have tried the following script:

#!/perl/bin/perl -wC

use Encode;

my $text = Encode::decode('latin2', 'mâta');

binmode(STDOUT, ":utf8");

print "Content-Type: text/html; Charset=UTF-8\n\n";
print Encode::encode('utf8', $text);


Well, the browser (Internet Explorer 6 prints:
mAcALÄf

... and not mâta

IE6 chooses the UTF-8 encoding but it doesn't print right the text.
However, Google's page is printed without any problems, but I saw that it
uses those special chars....


Thanks.

Teddy

----- Original Message ----- 
From: "Eric Cholet" <cholet(_at_)logilune(_dot_)com>
To: "Octavian Rasnita" <orasnita(_at_)fcc(_dot_)ro>
Cc: <perl-unicode(_at_)perl(_dot_)org>
Sent: Thursday, April 08, 2004 1:06 PM
Subject: Re: Creating a UTF-8 web page


Le 8 avr. 04, à 07:38, Octavian Rasnita a écrit :

Ok, thank you for your help, but I guess in this case my problem is
that I
don't know how to print the UTF8 string.
I want to get a latin2 text and print it as UTF-8 and I hope this is
not too

<Prev in Thread] Current Thread [Next in Thread>