Skip to content

fix: read and write text config files as UTF-8#1388

Closed
yosofbadr wants to merge 2 commits into
TagStudioDev:mainfrom
yosofbadr:fix/1345-io-settings-files-written-under-system-default-encoding-can-fail-on-non
Closed

fix: read and write text config files as UTF-8#1388
yosofbadr wants to merge 2 commits into
TagStudioDev:mainfrom
yosofbadr:fix/1345-io-settings-files-written-under-system-default-encoding-can-fail-on-non

Conversation

@yosofbadr

@yosofbadr yosofbadr commented Jun 15, 2026

Copy link
Copy Markdown

Summary

Draft / waiting on broader validation.

Fixes #1345 by reading and writing TagStudio text configuration/resource files with explicit encodings instead of relying on the system default encoding.

This keeps the change focused on text encoding handling: settings are read as UTF-8 first with a fallback for legacy non-UTF-8 files, then saved as UTF-8. Related generated ignore/resource text reads and writes now also specify UTF-8. I removed an unrelated generated uv.lock change from this PR.

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM - targeted local test/lint
    • Linux x86
    • Linux ARM
      • Not manually tested on a non-UTF-8 Windows desktop; covered locally by a cp932 regression fixture.
      • GitHub Actions for the latest push are awaiting maintainer approval on the fork.
  • Tested For:
    • Basic functionality - targeted settings encoding regression tests
    • PyInstaller executable
      • Local: uv run --extra pytest python -m pytest tests/qt/test_global_settings.py -q
      • Local: uv run --extra ruff ruff check src/tagstudio/qt/global_settings.py src/tagstudio/core/library/refresh.py src/tagstudio/qt/resource_manager.py src/tagstudio/core/library/alchemy/library.py tests/qt/test_global_settings.py
      • Missing before marking ready again: latest GitHub Actions run and/or Windows non-UTF-8 codepage validation.

@CyanVoxel CyanVoxel added the Status: Review Needed A review of this is needed label Jun 16, 2026
Keeps the encoding fix focused by dropping the uv.lock file that was generated during local verification.
@yosofbadr yosofbadr changed the title fix: +io: settings files written under system default encoding can fail... fix: read and write text config files as UTF-8 Jun 16, 2026
@yosofbadr yosofbadr marked this pull request as draft June 16, 2026 16:14
@yosofbadr

Copy link
Copy Markdown
Author

Closing this after a stricter audit. The issue is Windows/codepage-specific and the PR only has a synthetic local fixture, not real Windows validation. I do not want to leave maintainers with a PR I cannot confidently stand behind.

Sorry for the noise.

@yosofbadr yosofbadr closed this Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Review Needed A review of this is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]+io: settings files written under system default encoding can fail on non-UTF-8 codepages

2 participants