[gdal-dev] CPLReadLine2L and control characters

Martin Landa landa.martin at gmail.com
Fri Apr 20 13:55:13 PDT 2018


Hi,

when working on VFK driver improvements [0] I am dealing with various
problems. I found lines in sample data which contain 0x0x control
character [1] inside. CPLReadLine2L reads all characters:

(gdb) p pszRawLine[68]
$4 = 0 '\000'
(gdb) p pszRawLine[69]
$5 = 63 '?'
(gdb) p pszRawLine[70]
$6 = 4 '\004'
(gdb) p pszRawLine[71]
$8 = 0 '\000'
(gdb) p pszRawLine[72]
$7 = 34 '"'

But then strlen() stops on position 68 and rest of line is simply
lost. Do you have any idea how to deal with such data in reasonable
way?

Thanks a lot for pointers in advance! Martin

[0] https://github.com/OSGeo/gdal/issues/365
[1] https://en.wikipedia.org/wiki/ISO/IEC_8859-2
[2] http://geo102.fsv.cvut.cz/~landa/tmp/0xline.txt

-- 
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa


More information about the gdal-dev mailing list