From 9b9c6f38686d1dbfb992d4061a5620131c168d0d Mon Sep 17 00:00:00 2001 From: Michael Meier Date: Mon, 6 Jun 2016 09:13:07 +0200 Subject: [PATCH] we now have DBI::Pg >3, so we can properly handle utf8. --- scripts/osmbuildings-json-generator.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/osmbuildings-json-generator.pl b/scripts/osmbuildings-json-generator.pl index 3a39357..d0f5a98 100755 --- a/scripts/osmbuildings-json-generator.pl +++ b/scripts/osmbuildings-json-generator.pl @@ -143,11 +143,11 @@ $tx2 = $dbh->selectrow_array("select ST_X(ST_transform(ST_GeomFromText('POINT($x $ty2 = $dbh->selectrow_array("select ST_Y(ST_transform(ST_GeomFromText('POINT($x2 $y2)', 4326), 900913))"); # Why do crappy perl libraries always insist on using an "Object Oriented" interface # for things where this does not make any sense at all? -my $crappyjsonoo = JSON->new()->latin1(); # Note: has to be latin1 instead of utf8 -# for now, because the strings we get from the DB are WTF8, but are not marked -# as such. Therefore, we must not tell the JSON module to do utf8(), because -# otherwise it would encode the WTF8 twice. -# This will change with DBI::Pg modules >3 where UTF8 is properly handled. +my $crappyjsonoo = JSON->new()->utf8(); # Note: This has to be latin1 instead of +# utf8 for DBI::Pg modules with version <3, because in that case, the strings we +# get from the DB are WTF8, but are not marked as such. Therefore, we must not +# tell the JSON module to do utf8(), because otherwise it would encode the WTF8 +# twice. if ($verblev > 0) { $crappyjsonoo = $crappyjsonoo->pretty(); } -- 2.25.1