Skip to content

fix(cli): read commit message file as UTF-8#89

Merged
benner merged 1 commit into
mainfrom
fix/message-file-utf8-encoding
May 4, 2026
Merged

fix(cli): read commit message file as UTF-8#89
benner merged 1 commit into
mainfrom
fix/message-file-utf8-encoding

Conversation

@benner
Copy link
Copy Markdown
Owner

@benner benner commented May 4, 2026

Path.read_text() defaulted to the locale encoding, so a commit-msg hook
running under a non-UTF-8 LANG would fail to decode messages with
diacritics in the subject, body, or signed-off trailer. Git stores
messages as UTF-8 by convention; pin the encoding to match.

Path.read_text() defaulted to the locale encoding, so a commit-msg hook
running under a non-UTF-8 LANG would fail to decode messages with
diacritics in the subject, body, or signed-off trailer. Git stores
messages as UTF-8 by convention; pin the encoding to match.

Signed-off-by: Nerijus Bendžiūnas <nerijus.bendziunas@gmail.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Coverage

Coverage Report (Δ +0.0%)
FileStmtsMissCoverMissing
src/git_commit_guard
   __init__.py4710100% 
TOTAL4710100% 

@benner benner marked this pull request as ready for review May 4, 2026 02:53
@benner benner merged commit 2c1f293 into main May 4, 2026
7 checks passed
@benner benner deleted the fix/message-file-utf8-encoding branch May 4, 2026 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant