Skip to content

Commit 6175995

Browse files
authored
Allow charset to be unset (#42266)
2 parents e48bc00 + 58baaa4 commit 6175995

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)