no warnings qw(once);
use Encode;
use Time::HiRes;
-require './config.pm';
+use lib qw( include );
+require 'config.pm';
sub copy_escape {
my $x = shift;
if (!defined($x)) {
return '\N';
}
- $x = Encode::decode('iso8859-1', $x);
- $x =~ s/\\/\\\\/g;
- $x =~ s/\r/\\r/g;
- $x =~ s/\n/\\n/g;
- $x =~ s/\t/\\t/g;
+ $x =~ s/([\\\r\n\t])/\\$1/g;
return $x;
}
or die "PostgreSQL connect: " . $DBI::errstr;
$sdbh->{AutoCommit} = 0;
$sdbh->{RaiseError} = 1;
+$sdbh->do("SET client_encoding TO 'iso8859-1';");
# For our own enjoyment.
sync_table($mdbh, $sdbh, "Fotballbrukere");