🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.perl
Article #52244

Re: UTF8 w systemie

#52244
From: Stachu 'Dozzie' K.
Date: Tue, 07 Jun 2011 16:05
34 lines
2020 bytes
On 2011-06-07, Mateusz Szczyrzyca <mateusz@abstynenci.pl> wrote:
> Mam mały problem, zdawało mi się do tej pory, że w systemie utf8 mam 
> dobrze skonfigurowany. Teraz już nic nie wiem.
[...]
> I prosty skrypt pisany w tym vimie w tych locales:
>
> #v+
> $ cat test.pl 
> #!/usr/bin/perl -w
>
> use strict;
> use warnings;
> use utf8;
> use locale;
>
> print "Zażółć gęstą jaźń\n";
> $ ./test.pl 
> Wide character in print at ./test.pl line 8.
> Zażółć gęstą jaźń
> #v-

Bo `use locale' robi trochę co innego niż ci się wydaje. Zmienia tylko
zachowanie paru funkcji i operatorów do porównywania stringów (np.
sort(), cmp).

To co ty chcesz zrobić, załatwia się przez `use encoding ":locale"'
albo (dla przenośności nawet lepiej) przez `use encoding "utf8"'.

perldoc perllocale (sekcja "The use locale pragma")
perldoc encoding

-- 
Secunia non olet.
Stanislaw Klekot
Technical Details
Message-ID: <isli7f$gd4$1@solani.org>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!newsfeed.straub-nv.de!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail
References: <slrniusdri.pho.mateusz@jabber.abstynenci.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!newsfeed.straub-nv.de!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: "Stachu 'Dozzie' K." <dozzie@go.eat.some.screws.spammer.invalid>
Newsgroups: pl.comp.lang.perl
Subject: Re: UTF8 w systemie
Date: Tue, 7 Jun 2011 16:05:03 +0000 (UTC)
Organization: solani.org
Lines: 34
Message-ID: <isli7f$gd4$1@solani.org>
References: <slrniusdri.pho.mateusz@jabber.abstynenci.pl>
Mime-Version: 1.0
X-Trace: solani.org 1307462703 16804 eJwFwQkBACAIBLBKvAfGAYX+EdxcwbhhcJivLxVhWqA1R+jxWKraZF199Yipc5vGDiQ20B8buxEf (7 Jun 2011 16:05:03 GMT)
X-Complaints-To: abuse@news.solani.org
NNTP-Posting-Date: Tue, 7 Jun 2011 16:05:03 +0000 (UTC)
User-Agent: slrn/pre0.9.9-111 (Linux)
X-User-ID: eJwFwYEBwDAEBMCVgvdknFD2H6F3bhR2gE74+p5PC5pEWd57VNCYEE5JERlhuY3I19b9Rn8CPRCl
Cancel-Lock: sha1:v9UIi5ZH5Mw6eAvtUuE8ddb5ESA=
X-NNTP-Posting-Host: eJwFwQkBACAIA8BKfBsaRxD7R/AOTmVnEAw8PAcklbYUxZM5VnOwo2W/8Lhu3Wu0wvOScj4BGhBt
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit