[GRASS-dev] new v.in.geonames: problems with UTF-8 Unicode text

Markus Neteler neteler at osgeo.org
Tue Jul 1 05:54:31 EDT 2008


On Tue, Jul 1, 2008 at 11:38 AM, Markus Neteler <neteler at osgeo.org> wrote:
> The PostgreSQL driver has a function to find out the column length.
> With this change the full  "alternatename" field is imported into SQLite.
...

Using PostgreSQL instead, some escape problem happens (ok, slightly
offtopic for this thread but still related to v.in.geonames):

v.in.geonames /tmp/IT.csv out=it
...
D0/0: Escaped SQL: insert into it values ( 27788, 6485478, 'Hotel
Roma', 'Hotel Roma', null, 43.72241, 10.39204, 'S', 'HTL', 'IT', null,
'16', 'PI', null, null, 0, null, 1, 'Europe/Rome', '2007-04-15')
D0/0: Escaped SQL: insert into it values ( 27789, 6485480, 'Villa
Milani - Residenza d\\''epoca', 'Villa Milani - Residenza d\\''epoca',
null, 42.74533, 12.73843, 'S', 'HTL', 'IT', null, '18', 'PG', null,
null, 0, null, 374, 'Europe/Rome', '2007-04-15')
WARNING:  nonstandard use of \\ in a string literal
LINE 1: insert into it values ( 27789, 6485480, 'Villa Milani - Resi...
                                                ^
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
WARNING:  nonstandard use of \\ in a string literal
LINE 1: ..., 6485480, 'Villa Milani - Residenza d\\''epoca', 'Villa Mil...
                                                             ^
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
D0/0: Escaped SQL: insert into it values ( 27790, 6485481, 'Hotel Sher
Dan', 'Hotel Sher Dan', null, 40.72241, 8.39582, 'S', 'HTL', 'IT',
null, '1

I assume that the escape magic in db/drivers/postgres/execute.c isn't
perfect. Any suggestions here?

Markus


More information about the grass-dev mailing list