🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

printf problem z formatowaniem utf8 and iso-8859-2

#52553
From: yoawaoy
Date: Thu, 12 Sep 2013 09:23
13 lines
1813 bytes
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: <720e3d9d-d49a-410a-85cb-c342be618f46@googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin2!goblin.stu.neva.ru!feeder.erje.net!us.feeder.erje.net!news.glorb.com!b4no13239999pbq.1!news-out.google.com!z6ni46734pbu.0!nntp.google.com!y3no18647353pbx.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Received: by 10.66.144.41 with SMTP id sj9mr2996029pab.23.1378977818672;        Thu, 12 Sep 2013 02:23:38 -0700 (PDT)
X-Received: by 10.49.14.132 with SMTP id p4mr358489qec.2.1378977818509; Thu, 12 Sep 2013 02:23:38 -0700 (PDT)
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin2!goblin.stu.neva.ru!feeder.erje.net!us.feeder.erje.net!news.glorb.com!b4no13239999pbq.1!news-out.google.com!z6ni46734pbu.0!nntp.google.com!y3no18647353pbx.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: pl.comp.lang.perl
Date: Thu, 12 Sep 2013 02:23:38 -0700 (PDT)
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
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <720e3d9d-d49a-410a-85cb-c342be618f46@googlegroups.com>
Subject: printf problem z formatowaniem utf8 and iso-8859-2
From: yoawaoy@gmail.com
Injection-Date: Thu, 12 Sep 2013 09:23:38 +0000
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit