<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18812"></HEAD>
<BODY>
<DIV><SPAN lang=EN-GB>
<P><FONT size=2 face=Arial>Hi folks!</FONT></P>
<P><FONT size=2 face=Arial>I hope you can help me. I have searched google for
answers, but haven’t found any. So I thought going closer to the ’source’ might
help me.</FONT></P>
<P><FONT face=Arial><FONT size=2>In my organisation, we work with various GIS
data in different file formats. I have a project, where I need to put all these
data into a PostGIS database. So far I’m using the command line tool ogr2ogr to
inject the data. But I have problems with character encoding<SPAN
class=761271912-04092009>:</SPAN></FONT></FONT></P>ERROR 1: INSERT command for
new feature failed.<BR>ERROR: invalid byte sequence for encoding "UTF8":
0xf8<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".
<P><FONT size=2 face=Arial>My PostGIS database uses UTF-8 and the data I’m
working with (shape) is probably Latin1 encoded. </FONT></P>
<P><FONT size=2 face=Arial>I found a discussion where a user suggests that the
solution might be to do the following:</FONT></P>
<P><FONT size=2 face=Arial>ogr2ogr -f PostgreSQL PG:"host=localhost
user=username dbname=dbname password=password options='-c
client_encoding=latin1'" sourcefile;</FONT></P>
<P><FONT size=2 face=Arial>It does not seem to affect the injection. So, what am
I doing wrong?</FONT></P>
<P><FONT face=Arial><FONT size=2>Kind regards, Caspe<SPAN
class=761271912-04092009>r</SPAN></FONT></FONT></SPAN></P></DIV></BODY></HTML>