remove BOM when converting to string

fixes webpack/webpack#149