[gdal-dev] The new @filename syntax and UTF-8 with BOM

Jukka Rahkonen jukka.rahkonen at maanmittauslaitos.fi
Tue Oct 13 04:10:04 PDT 2015


Hi,

While testing the new ogr2ogr and ogrinfo option that was introduced in
https://trac.osgeo.org/gdal/changeset/30859 for reading contents for the
-where and -sql parameters from a file by using the @filename syntax I
noticed that system fails if the option file is saved with the Byte order
mark (BOM)

ERROR 1: SQL Expression Parsing Error: syntax error, unexpected end of
string. Occured around :
´╗┐{"query":

If I save the option file as UTF-8 without BOM then the file is read
correctly. Could GDAL be made to clarify the BOM if it exists, or should we
document that BOM is banned?

And now I understand why some of my mapfiles which I had to convert into
UTF-8 for Mapserver v. 7.0 did not work - the same BOM issue there.

-Jukka Rahkonen-


More information about the gdal-dev mailing list