-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.The question is answered.
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
Both these two lines of code work in PowerShell.
Write-Host “这是一段中文: This a paragrah of Chinese”
Write-Host "这是一段中文: This a paragrah of Chinese"
Did PowerShell just mean to do so or it was just a mistake of our developers ?
I was thinking if it is related to UTF-8 character set.
As you can see from the picture above, my Windows was not set to use UTF-8 character set.
Here is the output of $OutputEncoding
of my PowerShell
Preamble :
BodyName : utf-8
EncodingName : Unicode (UTF-8)
HeaderName : utf-8
WebName : utf-8
WindowsCodePage : 1200
IsBrowserDisplay : True
IsBrowserSave : True
IsMailNewsDisplay : True
IsMailNewsSave : True
IsSingleByte : False
EncoderFallback : System.Text.EncoderReplacementFallback
DecoderFallback : System.Text.DecoderReplacementFallback
IsReadOnly : True
CodePage : 65001
Expected behavior
`Write-Host “这是一段中文: This a a paragrah of Chinese”`
Code like this perhaps ought to be wrong.
Actual behavior
`Write-Host “这是一段中文: This a a paragrah of Chinese”`
Code like this works fine in PowerShell.
Error details
No response
Environment data
PSVersion 7.4.1
PSEdition Core
GitCommitId 7.4.1
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.The question is answered.