Opened 10 years ago

Closed 10 years ago

#4787 closed defect (invalid)

Increase CPG file priority when looking for shapefile encoding

Reported by: alexbruy Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SF Version: 1.9.1
Severity: normal Keywords: OGRShapeLayer, UTF-8, LDID, CPG
Cc:

Description

OGR can read shapefile encoding from both LDID and CPG file. But value from LDID has priority. This causes many problems when data are in one encoding but LDID value contains another. Such situation is quite common, because OGR by default always set LDID to 87, some other programs may don't fill LDID at all and finally some encodings (like UTF-8) has no corresponding LDID value.

I think, CPG file should have highest priority, so even if LDID value is wrong all data will be opened as expected. Also as CPG is a simple plain text file it is much easier for user to create or edit this file than change LDID value in DBF.

Change History (4)

comment:1 by Even Rouault, 10 years ago

I've reviewed dbfopen.c, and CPG file *does* have priority over LDID (see lines 493->513). Also confirmed by experiments. So you should provide more elements (possibly sample files) that demonstrate your issue.

comment:2 by Even Rouault, 10 years ago

Alex, do you have some update related to my previous comment ?

comment:3 by alexbruy, 10 years ago

Sorry for delay. Seems you are right, now I can't reproduce this error

comment:4 by Even Rouault, 10 years ago

Resolution: invalid
Status: newclosed

Ok. Closing with the assumption that it was a false positive. Re-open if you can reproduce

Note: See TracTickets for help on using tickets.