[gdal-dev] Re: Writing non-ASCII characters to shapefile

2010-07-06 Thread Francis Markham
Obviously it is easy enough to write the .CPG and overwrite a byte in the DBF in application code. However, I would rather use the OGR API for this. Would a patch providing this functionality be welcomed? If I were to implement this, would a "dataset creation option" in the shapefile driver be t

[gdal-dev] Re: Writing non-ASCII characters to shapefile

2010-07-06 Thread Hermann Peifer
In the mentioned mail from earlier this year, William Kyngesburye wrote: > Maybe GDAL needs a creation option in the shapefile driver > to set the LDID or to instead add a cpg file with an encoding value. As there was no reply to his mail, I assume that there is no GDAL/OGR creation option for

Re: [gdal-dev] Re: Writing non-ASCII characters to shapefile

2010-07-06 Thread Francis Markham
It appears from http://lists.osgeo.org/pipermail/gdal-dev/2010-May/024619.html and http://resources.arcgis.com/content/kbase?fa=articleShow&d=26015 that ESRI set the LDID to zero to indicate an unknown LDID. From my reading of the OGR sourcecode, it seems that OGR uses the shapelib default LDID o

Re: [gdal-dev] Re: Writing non-ASCII characters to shapefile

2010-07-06 Thread Hermann Peifer
The .cpg files we generate through ArcGIS desktop contain the string: UTF-8 Some time ago, there was a mail on this list about problems in case of conflicting information in the .cpg file compared to the Language Driver ID (LDID) in the header of a dBASE file, see: http://lists.osgeo.org/piper

Re: [gdal-dev] Re: Writing non-ASCII characters to shapefile

2010-07-05 Thread Francis Markham
Okay, I will take that approach then. Thank you all for your help. What specific value should I write into the .cpg? The string '65001' or the string 'utf-8' or something else? -Francis On 5 July 2010 21:53, Peter Hopfgartner wrote: > Hi Francis, > > what does not portable mean? ArcMap handles

Re: [gdal-dev] Re: Writing non-ASCII characters to shapefile

2010-07-05 Thread Peter Hopfgartner
Hi Francis, what does not portable mean? ArcMap handles UTF-8 fine, if the correct encoding is written into the .cpg file. Recent shapelib should handle this fine, too. If there is any problem with a specific GIS program, a bug report for that GIS program might be the right thing to do. Regards,

[gdal-dev] Re: Writing non-ASCII characters to shapefile

2010-07-05 Thread Francis Markham
At the bottom of this page, for one: http://resources.arcgis.com/content/kbase?fa=articleShow&d=21106 But honestly I've found hard to find information about this. I'd be very happy to be corrected if this is not the case! Cheers, Francis On 5 July 2010 19:09, Hermann Peifer wrote: > Francis,