<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>use psql2shp with the option -W with the def encoding perhaps cp1252</span></div><div><span>ie:</span></div><div><span>psql2shp -s 4326 -I -W cp1252  yourshape.shp layername > layername.sql.</span></div><div><br><span></span></div><div><span>Also you can use the psql2shp gui to import the file.</span></div><div><br><span></span></div><div><span>I don´t now other option but perhaps use LibreOffice, export de dbf file to the opendocument format then save as dbf but with UTF-8 encoding.</span></div><div><br><span></span></div><div><span>Hope this helps you.</span></div><div><br><span></span></div><div><span>Nahum<br></span></div><div> </div><div>--<br>Nahum Castro<br>Leon, Guanajuato, Mexico<br>http://www.leon-linux.com<br>e-mail: pedro1_72 [en] yahoo [punto] com<br></div>  <div style="font-family: times new
 roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">De:</span></b> Bob Pawley <rjpawley@shaw.ca><br> <b><span style="font-weight: bold;">Para:</span></b> postgis-users@postgis.refractions.net <br> <b><span style="font-weight: bold;">Enviado:</span></b> Miércoles, 14 de diciembre, 2011 12:28:40<br> <b><span style="font-weight: bold;">Asunto:</span></b> [postgis-users] Encoding problem UTF-8<br> </font> <br><div id="yiv2113637613">
<div dir="ltr">
<div dir="ltr">
<div style="FONT-FAMILY:'Times New Roman';COLOR:#00002b;FONT-SIZE:12pt;">
<div>Hi</div>
<div> </div>
<div>I am attempting to import a dxf file to Postgis using ogr2ogr version 1.8 
running on Win 7.</div>
<div> </div>
<div>I get errors “invalid byte sequence for encoding "UTF8": 0xfe” using the 
following command in command prompt. Points and text are not being 
imported.</div>
<div> </div>
<div>set DXF_INLINE_BLOCKS=false&set 
DXF_MERGE_BLOCK_GEOMETRIES=false&&ogr2ogr --config DXF_ENCODING UTF-8 -f 
"PostgreSQL" PG:"host=localhost user=postgres dbname=IDW password=calgary0623" 
Water_Ex.dxf -nln Import_PID  -overwrite -skipfailures </div>
<div> </div>
<div>During research of this problem I came upon a suggestion to check with the 
Postgre list.</div>
<div> </div>
<div>Can anyone suggest a solution?</div>
<div> </div>
<div>Following are a few of the error messages.</div>
<div> </div>
<div>Bob</div>
<div> </div>
<div>LIST', '{1,1,1}', 0) RETURNING ogc_fid</div>
<div>ERROR 1: INSERT command for new feature failed.</div>
<div>ERROR:  invalid byte sequence for encoding "UTF8": 0xfe</div>
<div> </div>
<div>Command: INSERT INTO "import_pid" ("wkb_geometry" , "layer", "subclasses", 
"exte</div>
<div>ndedentity", "entityhandle", "blockname", "blockscale", "blockangle") 
VALUES (Ge</div>
<div>omFromEWKT('SRID=-1;POINT (0.003291735334244 -0.065895915915561)'::TEXT) , 
'MC-A</div>
<div>TT', 'AcDbEntity:AcDbBlockReference', '     4 tag_rev1 
t      1 KEYTAG■C,10,0 RE</div>
<div>V_ID■C,10,0 REVISION■C,3,0 REVISED_BY■C,10,0 REVISED_ON■C,14,0 
REV_TITLE■C,32,0</div>
<div>REV_BY_APP■C,16,0 APPROVEDBY■C,10,0 PENDING■C,1,0 PEND_MAIL■C,10,0', 
'327A', '_A</div>
<div>T_DIRLIST', '{1,1,1}', 0) RETURNING ogc_fid</div>
<div>ERROR 1: INSERT command for new feature failed.</div>
<div>ERROR:  invalid byte sequence for encoding "UTF8": 0xfe</div>
<div> </div>
<div>Command: INSERT INTO "import_pid" ("wkb_geometry" , "layer", "subclasses", 
"exte</div>
<div>ndedentity", "entityhandle", "blockname", "blockscale", "blockangle") 
VALUES (Ge</div>
<div>omFromEWKT('SRID=-1;POINT (0.003291735334244 -0.065895915915561)'::TEXT) , 
'MC-A</div>
<div>TT', 'AcDbEntity:AcDbBlockReference', '     4 tag_rev2 
t      1 REV_ID■C,10,0 RE</div>
<div>V_DETAIL■C,50,0 REV_INT■N,3,0', '327B', '_AT_DIRLIST', '{1,1,1}', 0) 
RETURNING o</div>
<div>gc_fid</div>
<div>ERROR 1: INSERT command for new feature failed.</div>
<div>ERROR:  invalid byte sequence for encoding "UTF8": 0xfe</div>
<div> </div>
<div> </div>
<div> </div></div></div></div>
</div><br>_______________________________________________<br>postgis-users mailing list<br><a ymailto="mailto:postgis-users@postgis.refractions.net" href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br><br><br> </div> </div>  </div></body></html>