Skip to content

Commit d1c9c0c

Browse files
authored
[release/10.0.1xx] Allow charset to be unset (#50963)
2 parents 573598c + 56ccb8e commit d1c9c0c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/BuiltInTools/dotnet-format/Formatters/CharsetFormatter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ private static byte[] GetEncodedBytes(string text, Encoding encoding)
6868
private static bool TryGetCharset(AnalyzerConfigOptions analyzerConfigOptions, [NotNullWhen(true)] out Encoding? encoding)
6969
{
7070
if (analyzerConfigOptions != null &&
71-
analyzerConfigOptions.TryGetValue("charset", out var charsetOption))
71+
analyzerConfigOptions.TryGetValue("charset", out var charsetOption) &&
72+
charsetOption != "unset")
7273
{
7374
encoding = GetCharset(charsetOption);
7475
return true;

0 commit comments

Comments
 (0)