Re: Creating a UTF-8 web page

[email protected] ("Octavian Rasnita")
Newsgroups perl.unicode
Message-ID <017901c41d5d$94777fc0$251c320a@teddy>
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" <[email protected]>
To: "Octavian Rasnita" <[email protected]>
Cc: <[email protected]>
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
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.