<div dir="ltr">I see. So the output will default to <span style="font-family:arial,sans-serif;font-size:13px">ISO-8859-1 - regardless of the input .CPG - if the ENCODING flag isn't used.</span></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 7, 2014 at 3:08 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le samedi 08 novembre 2014 00:03:22, Roger André a écrit :<br>
<span class="">> Even,<br>
><br>
> Thank you for the quick reply. And it appears that using a .CPG file does<br>
> not make a difference in this. Is that correct?<br>
<br>
</span>You have to realize that the input and output side of ogr2ogr are completely<br>
isolated from each other.<br>
<br>
So if your input shapefile has a .cpg, the shapefile driver will use it to<br>
recode from the input dbf encoding mentionned in the .cpf to UTF-8 which is<br>
the pivot encoding of OGR (if the .cpg indicates UTF-8 then no recoding<br>
occurs)<br>
If the output is a shapefile and you specify -lco ENCODING=UTF-8, as the pivot<br>
encoding of OGR is UTF-8, no recoding will occur and an output .cpg file<br>
indicating UTF-8 will be generated.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> Roger<br>
><br>
> On Fri, Nov 7, 2014 at 3:00 PM, Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>><br>
><br>
> wrote:<br>
> > Le vendredi 07 novembre 2014 23:53:09, Roger André a écrit :<br>
> > > Hello List,<br>
> > ><br>
> > > I am very curious why after installing GDAL 1.11, I now need to use the<br>
> > > -lco ENCODING=UTF-8 option when using ogr2ogr on any of my already<br>
> > > UTF-8 encoded shapefiles? Failure to do so results in this error,<br>
> > ><br>
> > > Warning 1: One or several characters couldn't be converted correctly<br>
> > > from UTF-8 to ISO-8859-1.<br>
> ><br>
> > Roger,<br>
> ><br>
> > The default encoding of shapefiles is ISO-8859-1. So if you don't specify<br>
> > -lco<br>
> > ENCODING=UTF-8, the shapefile driver will attempt to recode from UTF-8 to<br>
> > ISO-8859-1. This behaviour has been introduced in GDAL 1.9. Previously no<br>
> > transcoding was done, and there could be mismatch between the actual<br>
> > encoding<br>
> > of the content and the declared encoding of the DBF.<br>
> ><br>
> > Even<br>
> ><br>
> > --<br>
> > Spatialys - Geospatial professional services<br>
> > <a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a><br>
<br>
--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a><br>
</div></div></blockquote></div><br></div>