[Buildsystem] Fix encoding when reading files
I added it to all cases with "r" I could find, didn't add it to "rb" as I assume those are read as binary and won't care about encoding, also there were some cases where there wasn't an explicit mode, left those, but if needed I'll add those too
See:
- https://github.com/godotengine/godot/issues/88901#issuecomment-2016773120
Would be good to find what caused the regression.
I assume maybe https://github.com/godotengine/godot/pull/89361 (cc @Repiteo).
I'd sooner assume #89333 as a possible culprit, which added explicit utf8 encoding to unspecified writes.
Agreed it seems to be the misalignment between reads and writes, unsure if we should instead remove enforcing it on either, but this solves at least the specific issue in the comment
Thanks!
Thank you!