Description
At the moment, decoding of source files does not handle exceptions. I added codec settings to PrebuildConfig.py
to mitigate this, but I'd much rather users don't have to mess with that.
This stack thread has some options: https://stackoverflow.com/questions/436220/how-to-determine-the-encoding-of-text
I'd like to avoid any nonstandard Python dependencies, so magic
and chardet
are off the table.
This answer, albeit brute-force, looks promising: https://stackoverflow.com/a/68701302/6272829
I think the list it checks should probably be smaller and in an order of likelihood that's more characteristic of UE code projects.
It'd probably be safe to determine codec for the first source file that's encountered and just assume it'll be the same for all proceeding source files.