[postgis-users] Read file encoding from from shape file

Stephen Woodbridge woodbri at swoodbridge.com
Sun Feb 28 16:16:41 PST 2010


Frank Warmerdam wrote:
> Paul Ramsey wrote:
>> I was never certain that ESRI software actually respected the DBF code
>> page flags, but your reference indicates they do, so this seems
>> reasonable. Some investigation of the current state of shapelib WRT
>> encoding would be wise, as I think we should update our shapelib to
>> the current version when we release 2.0.
> 
> Paul,
> 
> Encodings have not yet been addressed in shapelib or OGR but this is
> something for which pressure is growing.
> 
> Best regards,

Since I have had to deal with this for some clients, I have been working 
around this problem with the following:

I create a *.cpg file with the encoding string in it. Then when I 
manipulate the file like, loading it to postgis, I can read the .cpg 
file and set the encoding correctly. This works pretty well, except no 
other code knows about the .cpg files.

I would love it if shapelib appropriately handled code page info.

-Steve W



More information about the postgis-users mailing list