10 |
my $i = shift || 0; # isis repeatable number |
my $i = shift || 0; # isis repeatable number |
11 |
my $codepage = shift || die "parse_format must be called with codepage!"; |
my $codepage = shift || die "parse_format must be called with codepage!"; |
12 |
if ($type eq "isis") { |
if ($type eq "isis") { |
13 |
return parse_iso_format($format,$row,$i,$codepage,'isis_sf'); |
return parse_iso_format($format,$row,$i,$codepage,'hash_sf'); |
14 |
} elsif ($type eq "excel") { |
} elsif ($type eq "excel") { |
15 |
return parse_excel_format($format,$row,$i,$codepage); |
return parse_excel_format($format,$row,$i,$codepage); |
16 |
} elsif ($type eq "marc") { |
} elsif ($type eq "marc") { |
17 |
return parse_iso_format($format,$row,$i,$codepage,'marc_sf'); |
return parse_iso_format($format,$row,$i,$codepage,'marc_sf'); |
18 |
} elsif ($type eq "feed") { |
} elsif ($type eq "feed") { |
19 |
return parse_feed_format($format,$row,$i,$codepage); |
return parse_feed_format($format,$row,$i,$codepage); |
20 |
|
} elsif ($type eq "dbf") { |
21 |
|
return parse_iso_format($format,$row,$i,$codepage,'hash_sf'); |
22 |
|
} else { |
23 |
|
confess "FATAL: unknown type '$type'"; |
24 |
} |
} |
25 |
} |
} |
26 |
|
|
198 |
my $format = shift; |
my $format = shift; |
199 |
my $row = shift; |
my $row = shift; |
200 |
my $i = shift; |
my $i = shift; |
201 |
my $codepage = shift; |
#my $codepage = shift; |
202 |
|
# |
203 |
|
# data allready comes in utf-8 due to change in |
204 |
|
# SpreadSheet::ParseExcel::FmtDefault line 69 from |
205 |
|
# return pack('C*', unpack('n*', $sTxt)); |
206 |
|
# to following which returns utf-8: |
207 |
|
# return pack('U*', unpack('n*', $sTxt)); |
208 |
|
# |
209 |
|
|
210 |
return if ($i > 0); # Excel doesn't support repeatable fields |
return if ($i > 0); # Excel doesn't support repeatable fields |
211 |
|
|
226 |
#print STDERR "--$1-> $format -[",length($format),"] "; |
#print STDERR "--$1-> $format -[",length($format),"] "; |
227 |
if ($row->{$1}) { |
if ($row->{$1}) { |
228 |
my $tmp = $row->{$1}; |
my $tmp = $row->{$1}; |
|
if ($codepage) { |
|
|
$tmp = $codepage->convert($tmp) || warn "excel: $1 '$tmp' can't convert"; |
|
|
} |
|
229 |
$display .= $prefix . $tmp; |
$display .= $prefix . $tmp; |
230 |
$swish .= $tmp." "; |
$swish .= $tmp." "; |
231 |
#print STDERR " == $tmp"; |
#print STDERR " == $tmp"; |