Improve UTF-8-ness on a few scripts.

This commit is contained in:
Bradley M. Kuhn 2021-02-17 10:43:26 -08:00
parent 16ce9f4bf1
commit b16b4661ab
2 changed files with 6 additions and 2 deletions

View file

@ -6,6 +6,8 @@ use warnings;
use DBI; use DBI;
use Encode qw(encode decode); use Encode qw(encode decode);
use Supporters; use Supporters;
binmode STDIN, ":utf8";
binmode STDOUT, ":utf8";
if (@ARGV != 1 and @ARGV !=2) { if (@ARGV != 1 and @ARGV !=2) {
print STDERR "usage: $0 <SUPPORTERS_SQLITE_DB_FILE> <VERBOSITY_LEVEL>\n"; print STDERR "usage: $0 <SUPPORTERS_SQLITE_DB_FILE> <VERBOSITY_LEVEL>\n";

View file

@ -2,10 +2,13 @@
use strict; use strict;
use warnings; use warnings;
use utf8;
use autodie qw(open close); use autodie qw(open close);
use DBI; use DBI;
use Encode qw(encode decode);
binmode STDOUT, ":utf8";
binmode STDIN, ":utf8";
use Supporters; use Supporters;
@ -31,7 +34,6 @@ if ($CRITERION ne 'id') {
push(@supporterIds, $SEARCH_PARAMETER); push(@supporterIds, $SEARCH_PARAMETER);
} }
my @requestTypes = $sp->getRequestType(); my @requestTypes = $sp->getRequestType();
binmode STDOUT, ":utf8";
foreach my $id (@supporterIds) { foreach my $id (@supporterIds) {
$found = 1; $found = 1;
my $rtTicket = $sp->_getDonorField('rt_ticket', $id); my $rtTicket = $sp->_getDonorField('rt_ticket', $id);