Detect BOM when getting blob as string

Fixes #475