Scan enums error reporting

I added an enum in another branch and when I re-ran scan-enums it died because src/graphics/RenderTarget.h is not UTF-8. This makes scan_enums.py more robust to that error (giving a proper error message instead of a less informative stack trace) and fixes the file encoding.