Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4650 closed defect (fixed)

TestCapability OLCStringsAsUTF8 error in Shape driver

Reported by: bishop Owned by: warmerdam
Priority: normal Milestone: 1.9.2
Component: OGR_SF Version:
Severity: normal Keywords: OGRShapeLayer, OLCStringsAsUTF8, UTF8,
Cc:

Description

There is error in OGRShapeLayer::TestCapability? - OLCStringsAsUTF8 returns true anyway if shape driver could not recode strings, e.g. if GDAL build without iconv.

The GDAL compiled without iconv supports recoding of strings to UTF8 from UTF-8, UTF-16, UCS-2, UCS-4, ASCII, ISO-8859-1. If shapefile have any other encodings (e.g. WIN1251) GDAL sets OLCStringsAsUTF8 as true, but cannot recode from WIN1251 to UTF8. Then GDAL assumes the encoding as ISO-8859-1 and processes wrong recode from ISO-8859-1 to UTF8.

I get such GDAL error message:

Shape: DBF Codepage = LDID/87 for D:\work\testgeodata\shp\adm_rai.shp Shape: Treating as encoding 'ISO-8859-1'.

Change History (4)

comment:1 Changed 7 years ago by bishop

Resolution: fixed
Status: newclosed

The error was fixed in r24371

comment:2 in reply to:  1 Changed 7 years ago by bishop

Replying to bishop:

The error was fixed in r24371

The error was fixed in r24373

comment:3 Changed 7 years ago by Even Rouault

Component: defaultOGR_SF
Milestone: 1.9.2
Version: svn-trunk

r24553 /trunk/ (2 files in 2 dirs): Shape: make TestCapability?(OLCStringsAsUTF8) more robust by actually trying to recode field names (and also since r24514, Windows builds of GDAL can support some recoding from/to CPxxx even without iconv)

r24554 /branches/1.9/gdal/ogr/ogrsf_frmts/shape/ogrshapelayer.cpp: Shape: make TestCapability?(OLCStringsAsUTF8) more robust by actually trying to recode field names (#4650)

r24555 /trunk/gdal/ (5 files in 2 dirs): Additional fix for #4650

r24556 /branches/1.9/gdal/ (5 files in 2 dirs): Additional fix for #4650

comment:4 Changed 7 years ago by Even Rouault

r24557 /trunk/gdal/port/cpl_recode_stub.cpp: Add missing flags in CPLClearRecodeStubWarningFlags() (#4650)

r24558 /branches/1.9/gdal/port/cpl_recode_stub.cpp: Add missing flags in CPLClearRecodeStubWarningFlags() (#4650)

Note: See TracTickets for help on using tickets.