-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management module
Description
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 -ThrowExpected 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
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-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management module