Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebCmdlets parse XML declaration to get encoding value, if present. #18748

Merged
merged 10 commits into from
Jan 21, 2023
Prev Previous commit
Next Next commit
remove useless ()
  • Loading branch information
CarloToso committed Dec 8, 2022
commit ce00870d3287428cd415459028f1a2f48e6c12f0
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ internal static string DecodeStream(Stream stream, ref Encoding encoding)
if (match.Success || match2.Success)
{
Encoding localEncoding = null;
string characterSet = (string.IsNullOrEmpty(match.Groups["charset"].Value)) ? match2.Groups["encoding"].Value : match.Groups["charset"].Value;
string characterSet = string.IsNullOrEmpty(match.Groups["charset"].Value) ? match2.Groups["encoding"].Value : match.Groups["charset"].Value;

if (TryGetEncoding(characterSet, out localEncoding))
{
Expand Down