Conversation
This branch has not been deployed
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.
Converting with
--encoding utf-16currently succeeds but produces a file that cannot be decoded as UTF-16. The CLI encodes the result, thenclick.echoappends a raw one-byte newline. UTF-32 output has the same problem.Include the final newline in the text before encoding it, and tell Click not to append another one. This keeps the existing separators and UTF-8 output while producing valid multibyte text, including a single initial BOM where the encoding requires one. The change covers string and JSON results sent to a file or stdout. Binary results and separate-file output are unchanged.
This also touches the dictionary output branch in #102, but leaves its separate
-ofix to that PR.Validation on Windows, Python 3.12:
convert.pystill has pre-existing formatting differences on both revisions; unrelated formatting is left out of this patch.