File encoding check

Check for file encoding, with BOM support too. Great for PSR.