Hi Paal,<br><br>I think you may need to create the PostGIS database with the encoding set explicitly to 1252.<br><br>You can do that in the pgsql command line with, "createdb --encoding WIN1252 new_db".<br><br>Roger<br>
--<br><br><div class="gmail_quote">On Thu, May 1, 2008 at 2:09 PM, Paal Sund <<a href="mailto:paalsund@gmail.com">paalsund@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
I am getting the following error while loading a shapefile to postgis using ogr2ogr interactively from 'DOS' command window (cmd):<br>
<br>
ogr2ogr -f "PostgreSQL" -a_srs "EPSG:32633" PG:"<some values>" 33_n5000_bygg_punkt.shp -nln n5000_bygg_pun<br>
<br>
<br>
ERROR 1: INSERT command for new feature failed.<br>
<br>
FEIL: invalid byte sequence for encoding "UTF8": 0x86<br>
<br>
HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".<br>
<br>
<br>
Command: INSERT INTO "n5000_bygg_pun" (wkb_geometry , "area", "perimeter", "kupu<br>
<br>
nkt_", "kupunkt_id", "objtype", "ptema", "tett_id", "navn", "fyr_id", "oppdatert<br>
<br>
") VALUES (GeomFromEWKT('SRID=32768;POINT (897350 7911435)'::TEXT) ,<br>
<br>
0.00000, 0.00000, 11, 503, 'Tettsted', 4007, 860<br>
<br>
2, 'Honningsvåg', 0, 20010301)<br>
<br>
ERROR 1: Terminating translation prematurely after failed<br>
<br>
translation of layer 33_n5000_bygg_punkt<br>
<br>
<br>
<br>
<br>
My ogr2ogr is from the latest FWTools, running on Windows XP 2002 sp2.<br>
My PostGIS is from the latest windows binaries (postgresql 8.3 and the application stack builder)<br>
<br>
Any clues? The error message seems to point in the encoding direction. My shapefile has 1252 encoding.<br>
I havent done anything with encoding stuff in postgrsql.<br>
<br>
Help appreciated,<br>
best Pål Herman<br>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div><br>