Skip to content

fix(io): read and write TagStudio-owned text files as UTF-8 - #1575

Closed
sanketpatel32 wants to merge 1 commit into
TagStudioDev:mainfrom
sanketpatel32:devin/fix-utf8-file-encoding
Closed

sanketpatel32 wants to merge 1 commit into
TagStudioDev:mainfrom
sanketpatel32:devin/fix-utf8-file-encoding

Conversation

@sanketpatel32

Copy link
Copy Markdown

Summary

Fixes #1345. TagStudio-owned text files are now always read and written as UTF-8 instead of relying on the system default encoding (e.g. cp932 on Japanese Windows or cp1252), which could cause UnicodeDecodeErrors or nonconforming TOML/JSON — and corrupt libraries shared between systems:

  • app_settings.py: settings.toml read/write
  • refresh.py: .compiled_ignore (ripgrep patterns can legitimately contain non-ASCII characters)
  • ignore.py: .ts_ignore template read
  • migrations.py: .ts_ignore write during the v2 migration
  • resource_manager.py: bundled text resources (e.g. Qt stylesheets)

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality (test suite + pre-commit hooks passing)
    • PyInstaller executable

settings.toml, .compiled_ignore, the .ts_ignore template/migration
write, and bundled text resources are now always handled as UTF-8
instead of the system default encoding. Prevents UnicodeDecodeError
and nonconforming TOML/JSON on systems with non-UTF-8 codepages
(e.g. cp932 Windows), and on libraries shared between systems.

Refs TagStudioDev#1345
@CyanVoxel CyanVoxel closed this Nov 23, 2026
@TrigamDev TrigamDev added the Type: Invalid This doesn't seem right label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Invalid This doesn't seem right

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

3 participants