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

Stephen Woodbridge woodbri at swoodbridge.com
Tue Jan 6 12:18:59 PST 2015

Hi all,

I have run into a bunch of clients that edit their mapfiles (mostly on 
windows) and then get a mapserver error: about the mapfile not starting 
with the token MAP.

This is very hard to run down because you can not see these garbage 
characters in most editors. Doing a hex dump I get:

00000000  ef bb bf 4d 41 50 0a 20  20 4e 41 4d 45 20 22 4a  |...MAP. 

In vim, I just found out that I can:

:set nobomb

And that will remove it. Did I mention that this is really annoying 
because it is not obvious what the problem is!


1) anyone else run into this?
2) would it be a major security risk to ignore the BOM if it exists?
3) should I open a bug for this?
4) this probably happens on other text files also, but my guess is that 
they are less likely to be edited by the client so I'm not seeing it as 
a problem.


-Steve W

More information about the mapserver-dev mailing list