Show warning when UnicodeEncodeError is raised#178
Merged
jiasli merged 1 commit intomicrosoft:masterfrom Mar 10, 2020
Merged
Conversation
Member
Author
|
@shenmuxiaosen, please let me know if this solves the issue. |
fengzhou-msft
approved these changes
Mar 3, 2020
haroldrandom
approved these changes
Mar 3, 2020
Yes, the problem resolved after applying the solution 3. |
This was referenced May 7, 2021
This was referenced Dec 9, 2024
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.
Show warning when
UnicodeEncodeErroris raised.To test, on Windows go to Control Panel > Region > Administrative > Change system local and use English. Do not check Beta: Use Unicode UTF-8 for worldwide language support.
Open PowerShell terminal and run
az group show -n testrg { "id": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/testrg", "location": "centralus", "managedBy": null, "name": "testrg", "properties": { "provisioningState": "Succeeded" }, "tags": { "key0303": "测试€£¥テスト안녕𓀀𓀁𒀉𒅤" }, "type": "Microsoft.Resources/resourceGroups" }The output is correct, but if the output is redirected, PowerShell uses the system encoding. Thus
azwill silently remove the value ofkey0303:> $t = az group show -n testrg > $t { "id": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/testrg", "location": "centralus", "managedBy": null, "name": "testrg", "properties": { "provisioningState": "Succeeded" }, "tags": { "key0303": "" // value is removed }, "type": "Microsoft.Resources/resourceGroups" }The solution is any of
If none of the above solution is adopted, Knack will show a warning: