Skip to content

Commit d3812fe

Browse files
committed
Make sure our temp filehandles are doing UTF-8
1 parent 2b187cc commit d3812fe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

check_postgres.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2972,9 +2972,11 @@ sub run_command {
29722972

29732973
$tempdir = tempdir(@tempdirargs);
29742974
($tempfh,$tempfile) = tempfile('check_postgres_psql.XXXXXXX', SUFFIX => '.tmp', DIR => $tempdir);
2975+
binmode($tempfh, ':utf8');
29752976

29762977
## Create another one to catch any errors
29772978
($errfh,$errorfile) = tempfile('check_postgres_psql_stderr.XXXXXXX', SUFFIX => '.tmp', DIR => $tempdir);
2979+
binmode($errfh, ':utf8');
29782980

29792981
## Mild cleanup of the query
29802982
$string =~ s/^\s*(.+?)\s*$/$1/s;

0 commit comments

Comments
 (0)