20 |
'sn'=>'prezime', |
'sn'=>'prezime', |
21 |
'cn'=>'ime i prezime'); |
'cn'=>'ime i prezime'); |
22 |
|
|
23 |
|
%utf2iso_tab = ( |
24 |
|
0x0161 => 'š', 0x0111 => 'đ', 0x010d => 'č', 0x0107 => 'ć', 0x017e => 'ž', |
25 |
|
0x0160 => 'Š', 0x0110 => 'Đ', 0x010c => 'Č', 0x0106 => 'Ć', 0x017d => 'Ž' |
26 |
|
); |
27 |
|
|
28 |
print header(-type => 'text/html;charset=UTF-8'), |
sub utf2iso { |
29 |
|
my $out; |
30 |
|
foreach (@_) { |
31 |
|
s/([\xC0-\xDF])([\x80-\xBF])/$utf2iso_tab{unpack("c",$1)<<6&0x07C0|unpack("c",$2)&0x003F}/ge; |
32 |
|
s/([\xE0-\xEF])([\x80-\xBF])([\x80-\xBF])/$utf2iso_tab{unpack("c",$1)<<12&0xF000|unpack("c",$2)<<6&0x0FC0|unpack("c",$3)&0x003F}/ge; |
33 |
|
s/([\xF0-\xF7])([\x80-\xBF])([\x80-\xBF])([\x80-\xBF])/$utf2iso_tab{unpack("c",$1)<<18&0x1C0000|unpack("c",$2)<<12&0x3F000|unpack("c",$3)<<6&0x0FC0|unpack("c",$4)&0x003F}/ge; |
34 |
|
$out.=$_; |
35 |
|
} |
36 |
|
return $out; |
37 |
|
} |
38 |
|
|
39 |
|
print |
40 |
|
# header(-type => 'text/html;charset=UTF-8'), |
41 |
|
header, |
42 |
start_html('Naručivanje vizitki'), |
start_html('Naručivanje vizitki'), |
43 |
start_form, |
start_form, |
44 |
"Upišite svoje ",popup_menu(-name=>'what', |
"Upišite svoje ",popup_menu(-name=>'what', |
68 |
for($i = 0 ; $i < $max ; $i++) { |
for($i = 0 ; $i < $max ; $i++) { |
69 |
my $entry = $mesg->entry($i); |
my $entry = $mesg->entry($i); |
70 |
my ($mail) = $entry->get('mail'); # array, take first |
my ($mail) = $entry->get('mail'); # array, take first |
71 |
my ($cn)=$entry->get('cn'); |
my ($cn)=utf2iso($entry->get('cn')); |
72 |
push @radio_vals,$cn; |
push @radio_vals,$cn; |
73 |
$radio_labels{$cn}=$cn; |
$radio_labels{$cn}=$cn; |
74 |
} |
} |
108 |
close(LOG); |
close(LOG); |
109 |
} |
} |
110 |
} |
} |
111 |
|
|