-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Consider use UTF-8 by default for Azure CLI #28497
Copy link
Copy link
Open
Labels
Accountaz login/accountaz login/accountAuto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamact-identity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone
Metadata
Metadata
Assignees
Labels
Accountaz login/accountaz login/accountAuto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamact-identity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Describe the bug
I was reported a bug on StackOverflow: https://stackoverflow.com/q/78008939/910074
When I have to use
UTF-8for my default console output encoding ([Console]::OutputEncoding), the Azure CLI unable to handle Chinese characters because Encoding issue. It cause either Chinese chars missing or produce messy code.Related command
$(az account list -o json)az account list -o json | jq '.'Errors
Issue script & Debug output
It's an encoding issue.
Expected behavior
I expected Azure CLI can handle Chinese characters correctly.
Environment Summary
azure-cli 2.57.0
core 2.57.0
telemetry 1.1.0
Extensions:
account 0.2.3
azure-devops 0.25.0
front-door 1.0.16
interactive 0.4.5
k8s-extension 1.2.4
managementpartner 0.1.3
Dependencies:
msal 1.26.0
azure-mgmt-resource 23.1.0b2
Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\wakau.azure\cliextensions'
Python (Windows) 3.11.7 (tags/v3.11.7:fa7a6f2, Dec 4 2023, 19:24:49) [MSC v.1937 64 bit (AMD64)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
I have a workaround by now. Just edit
C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin\az.cmdfile. Add-X utf8to the python arguments.