Skip to content

Commit

Permalink
Merge pull request CESNET#838 from zlamalp/ifis
Browse files Browse the repository at this point in the history
fix(vsup_ifis): proper utf8 handling and column reference
  • Loading branch information
zlamalp authored Oct 5, 2023
2 parents 1d718c3 + 7224314 commit a921d88
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion send/VsupIfis.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ use Exporter 'import';
use strict;
use warnings FATAL => 'all';
use DBI;
use utf8;
use open qw/ :std :encoding(utf8) /;
binmode STDOUT, ":utf8";

#
# Return config
Expand All @@ -18,6 +21,7 @@ sub init_config($) {
my $result = {};

open FILE, $configPath or die "Could not open config file $configPath: $!";
binmode FILE, ":utf8";
while(my $line = <FILE>) {
if($line =~ /^username: .*/) {
my $username = ($line =~ m/^username: (.*)$/)[0];
Expand Down Expand Up @@ -65,7 +69,7 @@ sub load_stag() {
# Structure to store data from input database (IS/STAG)
my $inputData = {};
while(my $row = $sth->fetchrow_hashref()) {
my $key = $row->{vztah_cislo};
my $key = $row->{VZTAH_CISLO};
$inputData->{$key}->{'OSB_ID'} = $row->{UCO};
$inputData->{$key}->{'TYP_VZTAHU'} = $row->{TYP_VZTAHU};
$inputData->{$key}->{'DRUH_VZTAHU'} = $row->{DRUH_VZTAHU};
Expand Down

0 comments on commit a921d88

Please sign in to comment.