Increase CPG file priority when looking for shapefile encoding
|Reported by:||alexbruy||Owned by:||warmerdam|
|Severity:||normal||Keywords:||OGRShapeLayer, UTF-8, LDID, CPG|
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.