[mapserver-dev] Text editors adding UTF-8 BOM to mapfiles?

Even Rouault even.rouault at spatialys.com
Wed Jan 7 00:21:14 PST 2015

Le mardi 06 janvier 2015 22:39:45, Daniel Morissette a écrit :
> I never encountered this, but after reading about the BOM character for
> the first time [1], I am thinking that perhaps it would be worth
> modifying the MapServer mapfile parser to simply ignore the UTF-8 BOM
> code (EF BB BF) if it is present at the beginning of a map file since it
> should be safe to do so.
> However the other BOM values (for UTF-16 and UTF-32) should proably not
> be skipped as they are indicating that the file is binary encoded, and
> in this case we really need to care about the BOM and read the file as
> binary which would involve much more work in the parser.


For the record, those annoying BOM have been an issue reported by GDAL users 
for some text-based formats like CSV or GML and we've ended up skipping them 
(just the UTF-8 one).


Spatialys - Geospatial professional services

More information about the mapserver-dev mailing list