[23.0 backport] daemon/config: support alternate (common) unicode encodings using a BOM#44832
Merged
neersighted merged 3 commits intomoby:23.0from Jan 18, 2023
Merged
Conversation
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com> (cherry picked from commit 1dcf7d5) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This is a pragmatic but impure choice, in order to better support the default tools available on Windows Server, and reduce user confusion due to otherwise inscrutable-to-the-uninitiated errors like the following: > invalid character 'þ' looking for beginning of value > invalid character 'ÿ' looking for beginning of value While meaningful to those who are familiar with and are equipped to diagnose encoding issues, these characters will be hidden when the file is edited with a BOM-aware text editor, and further confuse the user. Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com> (cherry picked from commit d424950) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
…TF-8 This helps ensure that users are not surprised by unexpected tokens in the JSON parser, or fallout later in the daemon. Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com> (cherry picked from commit 8dbc5df) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Member
Author
|
@neersighted ptal 🤗 |
neersighted
approved these changes
Jan 18, 2023
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.
backports;
- What I did
Instead of merely stripping a UTF-8 BOM, interpret UTF-8 and UTF-16 BOMs in order to support the common encodings on Windows.
This is a pragmatic but impure choice, in order to better support the default tools available on Windows Server, and reduce user confusion due to otherwise inscrutable-to-the-uninitiated errors like the following:
While meaningful to those who are familiar with and are equipped to diagnose encoding issues, these characters will be hidden when the file is edited with a BOM-aware text editor, and further confuse the user.
- How I did it
- How to verify it
Unit tests
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)
