Get-Content with cast to [xml] doesn't properly detect encoding of input file
Get-Content with cast to [xml] doesn't properly detect encoding of input file
[xml]$xml = Get-Content $sample
where sample is an UTF-8 file and $xml is in CP-1251
The expectation is to have encoding detected automatically like it happend in XmlDocument.Load method
https://docs.microsoft.com/en-us/dotnet/api/system.xml.xmldocument.load?view=netframework-4.8
Please check attached script with the example of the bug.
1
vote
