From b087536b78ffc8da443ce0882de1e705fbb9dbd9 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 25 Aug 2012 13:18:08 +0200 Subject: [PATCH] Instead of translating back and forth between iso8859-1 and utf-8, tell the server to expect iso8859-1 right away. --- sync.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sync.pl b/sync.pl index c573259..113df7d 100755 --- a/sync.pl +++ b/sync.pl @@ -13,7 +13,6 @@ sub copy_escape { if (!defined($x)) { return '\N'; } - $x = Encode::decode('iso8859-1', $x); $x =~ s/([\\\r\n\t])/\\$1/g; return $x; } @@ -46,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"); -- 2.39.2