Sidebar

Why is  at the start of my file? And how do I remove them?

+1 vote
11.1K views
asked Oct 2, 2014 by mike-r-7535 (13,830 points)
edited Oct 2, 2014 by mike-r-7535

1 Answer

+2 votes
 
Best answer

This is a BOM, or a Byte Order Mark.  http://en.wikipedia.org/wiki/Byte_order_mark

It is the first bytes of a file which can be used to identify the byte order. When encoding the file as ISO-8859-1, the BOM looks like this: .

var diffusedBOM = message.getNode('/');
if (diffusedBOM.indexOf("") == 0) {
   diffusedBOM = diffusedBOM.replaceAll("", "");
}
 
If a string is encoded and then reencoded with a different encoding, the BOM can appear as a different character, like ÿ
answered Oct 2, 2014 by mike-r-7535 (13,830 points)
selected Oct 7, 2014 by mike-r-7535
...