Article View: pl.comp.lang.perl
Article #52554Re: printf problem z formatowaniem utf8 and iso-8859-2
From: yoawaoy
Date: Thu, 12 Sep 2013 12:07
Date: Thu, 12 Sep 2013 12:07
26 lines
2122 bytes
2122 bytes
W dniu czwartek, 12 września 2013 11:23:38 UTC+2 użytkownik yoa...@gmail.com napisał:
> Zaczytuje dane zakodowane w iso do skryptu .Robie jakieś działania na stingach
>
> poprzedzone decode("iso-8859-2",$string_wczytany) np tr, następnie wyjscie na stdout na ekran z locale ustawionymi na utf8_PL poprzez encode("utf8","string_wczytane_po_tr").
>
>
>
> Efekt jest taki że mam na stdout:
>
> np:
>
> Ala ma kota :text
>
> ala śćę :text
>
> przy formatowaniu printf "%-20.20s:%s,$string_po_encode,"text"";
>
>
>
> Problem jest taki, że kolumny są nie wyrówane do 20 znaków.znak ":" pływa.
>
> Jeśli encode zmienie na iso to znak ":" nie pływa a pojawiają się krzaki.
>
>
>
> Czy to da się jakoś ogarnać by był ładni kolunowo wypluty printf.
Technical Details
Message-ID:
<154c382f-6320-49a3-9faa-be733ffbd993@googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.cyf-kr.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder.erje.net!us.feeder.erje.net!news.glorb.com!b4no13508712pbq.1!news-out.google.com!z6ni46734pbu.0!nntp.google.com!y3no18922692pbx.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mailReferences:
<720e3d9d-d49a-410a-85cb-c342be618f46@googlegroups.com>Show Full Headers
Complete Article Headers
X-Received: by 10.66.250.233 with SMTP id zf9mr3464741pac.12.1378987675004; Thu, 12 Sep 2013 05:07:55 -0700 (PDT) X-Received: by 10.49.104.83 with SMTP id gc19mr2260qeb.12.1378987674927; Thu, 12 Sep 2013 05:07:54 -0700 (PDT) Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.cyf-kr.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder.erje.net!us.feeder.erje.net!news.glorb.com!b4no13508712pbq.1!news-out.google.com!z6ni46734pbu.0!nntp.google.com!y3no18922692pbx.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: pl.comp.lang.perl Date: Thu, 12 Sep 2013 05:07:54 -0700 (PDT) In-Reply-To: <720e3d9d-d49a-410a-85cb-c342be618f46@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=213.227.100.31; posting-account=SBycvgkAAADamTvCZmAlf2k1il34U7-j NNTP-Posting-Host: 213.227.100.31 References: <720e3d9d-d49a-410a-85cb-c342be618f46@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <154c382f-6320-49a3-9faa-be733ffbd993@googlegroups.com> Subject: Re: printf problem z formatowaniem utf8 and iso-8859-2 From: yoawaoy@gmail.com Injection-Date: Thu, 12 Sep 2013 12:07:55 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit