Related: #6562
Windows PowerShell has always supported the BigEndianUtf32 value for the -Encoding parameter of file-related cmdlets such as Get-Content, Set-Content and Out-File, to specify UTF-32BE encoding.
It is the big-endian counterpart to identifier UTF32, just like the still-supported BigendianUnicode value is the counterpart to Unicode (UTF-16LE).
You can work around the issue by passing a System.Text.Encoding name directly: -Encoding utf-32be, but for symmetry and backward compatibility BigEndianUtf32 should be supported in PS Core as well.
Steps to reproduce
{ 'hi' | Set-Content -ea stop -Encoding BigEndianUtf32 temp:$Pid.txt; ri temp:$Pid.txt } |
Should -Not -Throw
Expected behavior
The test should pass.
Actual behavior
The test fails:
Expected no exception to be thrown, but an exception
"Cannot process argument transformation on parameter 'Encoding'. 'BigEndianUtf32' is not a supported encoding name. ...
Environment data
PowerShell Core 7.0.0-rc.2
Related: #6562
Windows PowerShell has always supported the
BigEndianUtf32value for the-Encodingparameter of file-related cmdlets such asGet-Content,Set-ContentandOut-File, to specify UTF-32BE encoding.It is the big-endian counterpart to identifier
UTF32, just like the still-supportedBigendianUnicodevalue is the counterpart toUnicode(UTF-16LE).You can work around the issue by passing a
System.Text.Encodingname directly:-Encoding utf-32be, but for symmetry and backward compatibilityBigEndianUtf32should be supported in PS Core as well.Steps to reproduce
{ 'hi' | Set-Content -ea stop -Encoding BigEndianUtf32 temp:$Pid.txt; ri temp:$Pid.txt } | Should -Not -ThrowExpected behavior
The test should pass.
Actual behavior
The test fails:
Environment data