#!/usr/bin/perl

use strict;
use Text::Iconv;

my $converter=Text::Iconv->new("latin2","utf8");

open F, "/etc/passwd";
while (<F>) {
        my @r;
        chop;
        if ( @r=($_ =~ m/^([^:]+):[^:]+:([^:]+):[^:]+:([^:]+):[^:]+:[^:]+$/)) {
                $r[2]=~s/,*$//;
                if ($r[1]<1000 ) { next; }
                if ($r[1]>10000) { next; }
                print $r[0].":".$converter->convert($r[2])."\n";
#                print $r[0].":".$r[2]."\n";
        }
}
close F;
