Strip out the UTF8 BOM when encoding is 'utf8'

Some frameworks, such as .NET in my case, often emit the UTF8 byte-order-mark in the HTTP response.

This commit strips out the BOM when the encoding is set to 'utf8' and improves compatibility with external services.