TagStudio
TagStudio copied to clipboard
fix: call ripgrep with explicit utf-8 encoding.
Summary
Call ripgrep with explicit UTF-8 encoding to prevent issues with multi-byte characters.
When calling subprocess.Popen, (which is where silent_subprocess::silent_run eventually ends up) with text=True without specifying the encoding, python will use the encoding returned by locale::getencoding.
On Linux this returns UTF-8 while on Windows it will return cp1252 which causes issues with multi-byte characters like em dashes or Japanese characters.
Fixes https://github.com/TagStudioDev/TagStudio/issues/1195.
Before
I've omitted こんにちは.txt from the screenshot since it hangs the program with the error reported in https://github.com/TagStudioDev/TagStudio/issues/1195
After
Tasks Completed
- Platforms Tested:
- [x] Windows x86
- [ ] Windows ARM
- [ ] macOS x86
- [ ] macOS ARM
- [x] Linux x86
- [ ] Linux ARM
- Tested For:
- [x] Basic functionality
- [ ] PyInstaller executable