Skip to content
Snippets Groups Projects
Commit 5a90b2ba authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

changes from upstream

parents ab8e69f8 ddff6a6f
No related branches found
No related tags found
No related merge requests found
...@@ -55,6 +55,15 @@ sub write_json_file ...@@ -55,6 +55,15 @@ sub write_json_file
my $json= new JSON; my $json= new JSON;
my $json_str= $json->allow_blessed->convert_blessed->encode($x); my $json_str= $json->allow_blessed->convert_blessed->encode($x);
=begin comment
open (J, '>:utf8', $json_fnm) or die ("can not write to [$json_fnm]; caller:", join (' ', caller()));
syswrite (J, $json_str);
close (J);
=end comment
=cut
write_text($json_fnm, $json_str); write_text($json_fnm, $json_str);
1; 1;
......
...@@ -204,12 +204,16 @@ sub save_as_csv ...@@ -204,12 +204,16 @@ sub save_as_csv
my $eol= shift || "\n"; my $eol= shift || "\n";
my $utf8= shift || 0; my $utf8= shift || 0;
unless (open (FO, '>' . $fnm)) unless (open (FO, '>', $fnm))
{ {
print "ATTN: cant save as csv [$fnm]\n"; print "ATTN: cant save as csv [$fnm]\n";
return undef; return undef;
} }
binmode (FO, ':utf8') if ($utf8); if ($utf8)
{
print "ATTN: binmode :utf8 [$fnm]\n";
binmode (FO, ':utf8');
}
print FO join ($csv_sep, @$column_names), $eol; print FO join ($csv_sep, @$column_names), $eol;
my $lines= 0; my $lines= 0;
...@@ -238,7 +242,7 @@ sub save_hash_as_csv ...@@ -238,7 +242,7 @@ sub save_hash_as_csv
my $eol= shift || "\n"; my $eol= shift || "\n";
my $utf8= shift || 0; my $utf8= shift || 0;
unless (open (FO, '>' . $fnm)) unless (open (FO, '>', $fnm))
{ {
print "ATTN: cant save as csv [$fnm]\n"; print "ATTN: cant save as csv [$fnm]\n";
return undef; return undef;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment