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

Refactor UTF-7 encoding detection #18384

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use WarnIfObsolete in EncodingConversion
  • Loading branch information
xtqqczze committed Oct 25, 2022
commit ffe4b12c8c3899d4e5ab0c9423bc2b41e454e1a9
6 changes: 1 addition & 5 deletions src/System.Management.Automation/utils/EncodingUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ internal static Encoding Convert(Cmdlet cmdlet, string encoding)
Encoding foundEncoding;
if (encodingMap.TryGetValue(encoding, out foundEncoding))
{
// Write a warning if using utf7 as it is obsolete in .NET5
if (string.Equals(encoding, Utf7, StringComparison.OrdinalIgnoreCase))
{
cmdlet.WriteWarning(PathUtilsStrings.Utf7EncodingObsolete);
}
WarnIfObsolete(cmdlet, foundEncoding);

return foundEncoding;
}
Expand Down