Closed chrisvigil closed 9 months ago
I haven't had any issues with that mod.
take a quick look at utility.encoding.py, the method decode_bytes_with_fallbacks
already autodetects then falls back to compatible encodings when one isn't found, with the ultimate fallback always being utf-8. There are also many tests in pykotor/src/tests/test_encoding.py.
not to say I'm skeptical of your pr at all, i'm just saying it's more likely it is perhaps your operating system, python version, or hardware? Can you open an issue that'll successfully reproduce this problem on the latest v1.43 holopatcher?
If not I'll take a look at this later in the week. Thanks for reporting this problem.
Jupp I get the issue with the latest 1.4.3 release without my patch and my patch solves the issue for me.
decode_bytes_with_fallbacks doesn't appear to be used when reading rtf files.
It's quite likely a Linux only issue if you haven't see it before.
OS: Arch Linux Python Version: 3.11.6
Yes that's exactly it: I was able to reproduce on Linux, but not Windows. Thanks for reporting this.
Ah, you're correct, it was using default encoding (utf-8) without any detection whatsoever.
Cheers mate.
When HoloPatcher attempts to load a info.rtf for a mod with an encoding other then UTF-8 it will fail.
Added autodetection of encoding which will fall back on UTF-8
Confirmed working with mod New_Lightsaber_Blade_Model_TSL 1.0.0 that has info.rtf files with latin1 encoding.