]> git.sesse.net Git - wloh/blobdiff - sync.pl
Remove dead function print_navbar().
[wloh] / sync.pl
diff --git a/sync.pl b/sync.pl
index 9af864217b9712c67e7fc8536779e87e69c2aa15..113df7d93ba04ae3b0cc07ce0696016c8e145bab 100755 (executable)
--- a/sync.pl
+++ b/sync.pl
@@ -13,11 +13,7 @@ sub copy_escape {
        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;
 }
 
@@ -49,6 +45,7 @@ my $sdbh = DBI->connect($config::local_connstr, $config::local_username, $config
        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");