Repository navigation
extract: write output files as UTF-8 - #216
Closed
ryanduguid wants to merge 2 commits into
Closed
ryanduguid wants to merge 2 commits into
ryanduguid wants to merge 2 commits into
Conversation
Run the CLI with a cp1252 charset so the standard-output cases fail without the fix, as the file case already did.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Saving extracted transactions with
-o FILEuses the platform's default encoding. On Windows CP1252, a narration such asPayment from 管財人raisesUnicodeEncodeError. Set the existing Click file type to UTF-8 so the output can represent the transaction text.The regression test runs the extraction command through the existing identity importer, simulates CP1252 for Click's file opens and parses the result to verify the narration. It covers named files, default stdout and explicit
-o -.Fixes #206.
Validation:
UnicodeEncodeErrorunder the simulated CP1252 default, and passes afterwards.python -m pytest beangulp: 144 passed, 3 skipped, 16 failed. An unchanged checkout at d5672c9 has 143 passed, 3 skipped and the same 16 failures, involving Windows paths, temporary files, MIME detection and related doctests.ruff check beangulp/ examples/passes with Ruff 0.12.12. Formatting and whitespace checks pass for the changed files.Output files now consistently use UTF-8, including on systems with a different default encoding. The Linux test matrix and example importer checks remain for CI; they were not run locally.