characters appended to the beginning of each file  characters appended to the beginning of each file asp.net asp.net

 characters appended to the beginning of each file


Its the UTF Byte Order Mark (BOM).

It will be at the start of each file, but your editor will ignore them there. When concatenated they end up in the middle, so you see them.


OK, I've debugged your code.

BOM marks appear in the source stream when the files are being read from the disk:

byte[] bytes = File.ReadAllBytes(physicalPath);// TODO: Convert unicode files to specified encoding. For now, assuming// files are either ASCII or UTF8

If you read the files properly, you can get rid of the marks.