Article View: pl.comp.lang.perl
Article #40001Re: Polskie znaki - ponownie
From: Szymon Sokół
Date: Fri, 12 Nov 2004 16:49
Date: Fri, 12 Nov 2004 16:49
23 lines
1914 bytes
1914 bytes
On 12 Nov 2004 12:29:40 +0100, Adam wrote: > 2. Czy skrypt poniżej powinien wyświetlać prawidłowo polskie znaki: > > #!/usr/bin/perl > use POSIX qw(setlocale); > setlocale(LC_ALL,"pl_PL.iso88592"); > print "Content-type:text/html\n\n"; > print "<H1>Witaj świecie okrągły i równy</H1>\n"; Wyświetlać - tak. To znaczy, jak go odpalisz z linii komend, to powinien. Ale sądząc z tego, co ma wypisać, to to ma być CGI, prawda? No to jak CGI, to brakuje deklaracji charsetu, bez której przeglądarka nie będzie wiedzieć (bo niby skąd??), jaki to charset. Powinno być: print "Content-type:text/html; charset=ISO-8859-2\n\n"; i w tym momencie locale po stronie serwera nie ma już najmniejszego znaczenia. -- Szymon Sokół (SS316-RIPE) -- Network Manager B Computer Center, AGH - University of Science and Technology, Cracow, Poland O http://home.agh.edu.pl/szymon/ PGP key id: RSA: 0x2ABE016B, DSS: 0xF9289982 F Free speech includes the right not to listen, if not interested -- Heinlein H
Technical Details
Message-ID:
<cn2t31.3vvf5uf.1@sloth.hell.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!agh.edu.pl!news.agh.edu.pl!dustpuppy.sloth.hell.pl!not-for-mailReferences:
<5e1e.00000974.41949ea3@newsgate.onet.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!agh.edu.pl!news.agh.edu.pl!dustpuppy.sloth.hell.pl!not-for-mail From: Szymon Sokół <szymon@bastard.operator.from.hell.pl> Newsgroups: pl.comp.lang.perl Subject: Re: Polskie znaki - ponownie Date: Fri, 12 Nov 2004 17:49:22 +0100 Organization: Guy Fawkes Society Lines: 23 Message-ID: <cn2t31.3vvf5uf.1@sloth.hell.pl> References: <5e1e.00000974.41949ea3@newsgate.onet.pl> NNTP-Posting-Host: chello062179072161.chello.pl Mime-Version: 1.0 X-Trace: galaxy.uci.agh.edu.pl 1100278433 28076 62.179.72.161 (12 Nov 2004 16:53:53 GMT) X-Complaints-To: usenet@uci.agh.edu.pl NNTP-Posting-Date: Fri, 12 Nov 2004 16:53:53 +0000 (UTC) User-Agent: 40tude_Dialog/2.0.14.1 Hamster/2.0.1.3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit