[postgis-users] re: shp2sql and UTF8 question on Windows
Mark Cave-Ayland
m.cave-ayland at webbased.co.uk
Thu Jan 26 04:49:31 PST 2006
Hi strk,
> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-
> bounces at postgis.refractions.net] On Behalf Of strk at refractions.net
> Sent: 26 January 2006 12:08
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] re: shp2sql and UTF8 question on Windows
(cut)
> The main problem was strings not being properly escaped.
> This brought IIDA Tetsushi to send out a patch.
>
> Talking with pgsql guys I come to using UTF8 middle-encoding
> to ensure quotes and backslashes (in the lower 7bits) would
> have been correctly hanlded.
>
> For background info, see:
> http://postgis.refractions.net/pipermail/postgis-devel/2005-
> January/000798.html
For Tetsushi's case above, the correct handling would be to output SET
CLIENT_ENCODING TO SJIS with a database encoding of UNICODE. It looks like
SJIS encoding is only supported under PostgreSQL 8.1 though.
> Would setting PGOPTIONS work ?
>
> ./shp2pgsql ... | PGOPTIONS="-c client_encoding=EBCDIC" psql
Or the page also mentions you can set the environment variable
PGCLIENTENCODING.
I also like the idea of defaulting to UTF8 (unless another is specified
using Markus' patch) and issuing warnings about mismatched encodings if bit
7 is set.
Kind regards,
Mark.
------------------------
WebBased Ltd
17 Research Way
Plymouth
PL6 8BT
T: +44 (0)1752 797131
F: +44 (0)1752 791023
http://www.webbased.co.uk
http://www.infomapper.com
http://www.swtc.co.uk
This email and any attachments are confidential to the intended recipient
and may also be privileged. If you are not the intended recipient please
delete it from your system and notify the sender. You should not copy it or
use it for any purpose nor disclose or distribute its contents to any other
person.
More information about the postgis-users
mailing list