1 type derived from UTF8Encoding
System.Private.CoreLib (1)
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.Sealed.cs (1)
17internal sealed class UTF8EncodingSealed : UTF8Encoding
250 instantiations of UTF8Encoding
Aspire.Templates.Tests (1)
TemplateTestsBase.cs (1)
381UTF8Encoding utf8 = new();
csc (1)
src\Compilers\Shared\ConsoleUtil.cs (1)
14private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
dotnet-svcutil-lib (13)
CodeSerializer.cs (1)
23private static readonly Encoding s_ouputEncoding = new System.Text.UTF8Encoding(true);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextReaderImpl.cs (3)
3236return new UTF8Encoding(true, true); 3321newEncoding = new UTF8Encoding(true, true); 3387SwitchEncoding(new UTF8Encoding(true, true));
FrameworkFork\System.Runtime.Serialization\System\Xml\EncodingStreamWrapper.cs (2)
23private static readonly UTF8Encoding s_safeUTF8 = new UTF8Encoding(false, false); 26private static readonly UTF8Encoding s_validatingUTF8 = new UTF8Encoding(false, true);
FrameworkFork\System.Runtime.Serialization\System\Xml\ValueHandle.cs (1)
693UTF8Encoding encoding = new UTF8Encoding(false, true);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlConverter.cs (1)
55s_utf8Encoding = new UTF8Encoding(false, true);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlDictionaryWriter.cs (1)
43private static readonly Encoding s_UTF8Encoding = new UTF8Encoding(false);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlExceptionHelper.cs (1)
274return CreateEncodingException(new System.Text.UTF8Encoding(false, false).GetString(buffer, offset, count), exception);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlStreamNodeWriter.cs (1)
24private static UTF8Encoding s_UTF8Encoding = new UTF8Encoding(false, true);
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\WSSecurityJan2004.cs (1)
319writer.WriteString(new UTF8Encoding().GetString(keyIdentifier, 0, keyIdentifier.Length));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (1)
579byte[] inputBytes = new UTF8Encoding().GetBytes(inputString);
GenerateDocumentationAndConfigFiles (4)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
20private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
249s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
14private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
GetDocument.Insider (1)
Commands\GetDocumentCommandWorker.cs (1)
34= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
http2cat (2)
src\Shared\Http2cat\Http2Utilities.cs (1)
34private static readonly Encoding HeaderValueEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
97new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetByteCount(value);
IIS.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\BasicAuthTests.cs (1)
61var byteArray = new UTF8Encoding().GetBytes(username + ":" + password);
src\Shared\Http2cat\Http2Utilities.cs (1)
34private static readonly Encoding HeaderValueEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
97new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetByteCount(value);
IIS.LongTests (2)
src\Shared\Http2cat\Http2Utilities.cs (1)
34private static readonly Encoding HeaderValueEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
97new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetByteCount(value);
IIS.NewHandler.FunctionalTests (2)
src\Shared\Http2cat\Http2Utilities.cs (1)
34private static readonly Encoding HeaderValueEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
97new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetByteCount(value);
IIS.NewShim.FunctionalTests (2)
src\Shared\Http2cat\Http2Utilities.cs (1)
34private static readonly Encoding HeaderValueEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
97new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetByteCount(value);
IIS.ShadowCopy.Tests (1)
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
97new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetByteCount(value);
IISExpress.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\BasicAuthTests.cs (1)
61var byteArray = new UTF8Encoding().GetBytes(username + ":" + password);
src\Shared\Http2cat\Http2Utilities.cs (1)
34private static readonly Encoding HeaderValueEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
97new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetByteCount(value);
Metrics (4)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
20private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
249s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
14private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Metrics.Legacy (4)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
20private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
249s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
14private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.Components.Server (1)
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\StringEncoding.cs (1)
14internal static readonly Encoding UTF8 = new UTF8Encoding(false);
Microsoft.AspNetCore.Components.Web.Tests (1)
HtmlRendering\HtmlRendererTest.cs (1)
846using var writer = new StreamWriter(ms, new UTF8Encoding(false));
Microsoft.AspNetCore.DataProtection (1)
src\DataProtection\shared\src\EncodingUtil.cs (1)
11public static readonly UTF8Encoding SecureUtf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.DataProtection.Abstractions (1)
src\DataProtection\shared\src\EncodingUtil.cs (1)
11public static readonly UTF8Encoding SecureUtf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.DataProtection.Extensions (1)
src\DataProtection\shared\src\EncodingUtil.cs (1)
11public static readonly UTF8Encoding SecureUtf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.DataProtection.Tests (1)
KeyManagement\KeyRingBasedDataProtectorTests.cs (1)
631var writer = new BinaryWriter(memStream, encoding: new UTF8Encoding(encoderShouldEmitUTF8Identifier: false), leaveOpen: true);
Microsoft.AspNetCore.Diagnostics (1)
src\Shared\RazorViews\BaseView.cs (1)
21private static readonly Encoding UTF8NoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
src\Shared\RazorViews\BaseView.cs (1)
21private static readonly Encoding UTF8NoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.Hosting (1)
src\Shared\RazorViews\BaseView.cs (1)
21private static readonly Encoding UTF8NoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.Http.Connections.Common (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.Identity (1)
DataProtectorTokenProvider.cs (1)
198internal static readonly Encoding DefaultEncoding = new UTF8Encoding(false, true);
Microsoft.AspNetCore.Identity.FunctionalTests (1)
src\Identity\Extensions.Core\src\Rfc6238AuthenticationService.cs (1)
18private static readonly Encoding _encoding = new UTF8Encoding(false, true);
Microsoft.AspNetCore.Mvc.Core (1)
Formatters\TextInputFormatter.cs (1)
19= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.Mvc.IntegrationTests (2)
ComplexRecordIntegrationTest.cs (1)
4205var stream = new MemoryStream(new UTF8Encoding(encoderShouldEmitUTF8Identifier: false).GetBytes(content));
ComplexTypeIntegrationTestBase.cs (1)
3704var stream = new MemoryStream(new UTF8Encoding(encoderShouldEmitUTF8Identifier: false).GetBytes(content));
Microsoft.AspNetCore.OpenApi (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (1)
SnapshotTestHelper.cs (1)
199var encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.Server.HttpSys (2)
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
17private static readonly Encoding UTF8 = new UTF8Encoding(
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
97new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetByteCount(value);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
src\Shared\Http2cat\Http2Utilities.cs (1)
34private static readonly Encoding HeaderValueEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.Server.IIS (3)
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
17private static readonly Encoding UTF8 = new UTF8Encoding(
src\Shared\RazorViews\BaseView.cs (1)
21private static readonly Encoding UTF8NoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
97new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetByteCount(value);
Microsoft.AspNetCore.Server.Kestrel.Core (2)
Internal\Infrastructure\HttpUtilities.cs (1)
30private static readonly UTF8Encoding DefaultRequestHeaderEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
97new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetByteCount(value);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
97new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetByteCount(value);
Microsoft.AspNetCore.Shared.Tests (2)
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
17private static readonly Encoding UTF8 = new UTF8Encoding(
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
97new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetByteCount(value);
Microsoft.AspNetCore.SignalR.Common (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.WebUtilities.Tests (1)
HttpResponseStreamWriterTest.cs (1)
19var encodingWithBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
Microsoft.Build (2)
Logging\BinaryLogger\BuildEventArgsReader.cs (1)
1834var utf8noBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Xml\XmlReaderExtension.cs (1)
30private static readonly Encoding s_utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.Build.Engine.OM.UnitTests (2)
Construction\ProjectFormatting_Tests.cs (2)
646using StringWriter writer = new EncodingStringWriter(new UTF8Encoding(encoderShouldEmitUTF8Identifier: true)); 689File.WriteAllText(file, content, new UTF8Encoding(encoderShouldEmitUTF8Identifier: byteOrderMark));
Microsoft.Build.Engine.UnitTests (1)
Evaluation\Expander_Tests.cs (1)
1818UTF8Encoding enc = new UTF8Encoding();
Microsoft.Build.Framework (1)
EncodingUtilities.cs (1)
25internal static readonly Encoding Utf8WithoutBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.Build.Tasks.CodeAnalysis (2)
src\Compilers\Core\MSBuildTask\GenerateMSBuildEditorConfig.cs (1)
125var encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Compilers\Shared\ConsoleUtil.cs (1)
14private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.Build.Tasks.CodeAnalysis.Sdk (2)
src\Compilers\Core\MSBuildTask\GenerateMSBuildEditorConfig.cs (1)
125var encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Compilers\Shared\ConsoleUtil.cs (1)
14private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.Build.Tasks.Core (3)
FileIO\WriteLinesToFile.cs (1)
22private static readonly Encoding s_defaultEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
GenerateResource.cs (1)
3567using (LineNumberStreamReader sr = new LineNumberStreamReader(fs, new UTF8Encoding(true), true))
StreamMappedString.cs (1)
121Encoding utf8Encoding = new UTF8Encoding(false, true /* throw on illegal bytes */);
Microsoft.Build.Tasks.UnitTests (3)
Exec_Tests.cs (3)
483RunExec(true, new UTF8Encoding(false).EncodingName); 501RunExec(true, new UTF8Encoding(false).EncodingName, "Always"); 510RunExec(false, new UTF8Encoding(false).EncodingName, "Always");
Microsoft.CodeAnalysis (4)
EncodedStringText.cs (1)
20private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
InternalUtilities\StringExtensions.cs (1)
249s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Text\SourceText.cs (1)
48private static readonly Encoding s_utf8EncodingWithNoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false);
Text\SourceTextStream.cs (1)
29private static readonly Encoding s_utf8EncodingWithNoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false);
Microsoft.CodeAnalysis.Analyzers (4)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
20private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
249s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
14private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.CodeAnalysis.AnalyzerUtilities (4)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
20private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
249s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
14private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.CodeAnalysis.BannedApiAnalyzers (4)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
20private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
249s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
14private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.CodeAnalysis.CodeStyle (3)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
20private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
249s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.CodeAnalysis.CSharp (3)
Compiler\DocumentationCommentCompiler.cs (1)
94encoding: new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false),
Symbols\FileIdentifier.cs (1)
22private static readonly Encoding s_encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Utilities\InterceptableLocation.cs (1)
54private static readonly UTF8Encoding s_encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (7)
PDB\CSharpDeterministicBuildCompilationTests.cs (3)
114}", filename: "b.cs", options: parseOptions, encoding: new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 174}", filename: "b.cs", options: parseOptions, encoding: new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 238}", filename: "b.cs", options: parseOptions, encoding: new UTF8Encoding(encoderShouldEmitUTF8Identifier: false));
PDB\PDBTests.cs (4)
67var tree3 = SyntaxFactory.ParseSyntaxTree("class C { public void F() { } }", encoding: new UTF8Encoding(true, false), path: "Bar.cs"); 68var tree4 = SyntaxFactory.ParseSyntaxTree(SourceText.From("class D { public void F() { } }", new UTF8Encoding(false, false)), path: "Baz.cs"); 77var hash3 = CryptographicHashProvider.ComputeSha1(new UTF8Encoding(true, false).GetBytesWithPreamble(tree3.ToString())).ToArray(); 78var hash4 = CryptographicHashProvider.ComputeSha1(new UTF8Encoding(false, false).GetBytesWithPreamble(tree4.ToString())).ToArray();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Attributes\AttributeTests_Assembly.cs (1)
353var utf8 = new System.Text.UTF8Encoding(false, false);
Microsoft.CodeAnalysis.EditorFeatures (1)
Workspaces\EditorTextFactoryService.cs (1)
30private static readonly Encoding s_throwingUtf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
Workspaces\TextFactoryTests.cs (3)
46expectedEncoding: new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true)); 57new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetBytes("Test"), 72.. new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetBytes("Test"),
Microsoft.CodeAnalysis.Extensions.Package (1)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
249s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (4)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
20private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
249s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
14private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.CodeAnalysis.PublicApiAnalyzers (4)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
20private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
249s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
14private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.CodeAnalysis.ResxSourceGenerator (4)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
20private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
249s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
14private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.CodeAnalysis.Test.Utilities (1)
EncodingTestHelpers.cs (1)
23yield return new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.CodeAnalysis.UnitTests (20)
EmbeddedTextTests.cs (1)
103var source = SourceText.From("", new UTF8Encoding(encoderShouldEmitUTF8Identifier: false), SourceHashAlgorithm.Sha1);
Text\SourceTextStreamTests.cs (1)
17private static readonly Encoding s_utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Text\SourceTextTests.cs (9)
54var utf8NoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false); 71var utf8BOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true); 112var encodingNoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false); 113var encodingBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true); 251var encodings = new[] { null, Encoding.ASCII, new UTF8Encoding(encoderShouldEmitUTF8Identifier: true), new UTF8Encoding(encoderShouldEmitUTF8Identifier: false) }; 282var encodings = new[] { null, Encoding.ASCII, new UTF8Encoding(encoderShouldEmitUTF8Identifier: true), new UTF8Encoding(encoderShouldEmitUTF8Identifier: false) }; 377var utf8NoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Text\StringTextDecodingTests.cs (7)
154var utf8 = new UTF8Encoding(false, true); 188var utf8 = new UTF8Encoding(false, true); 217var encoding = new UTF8Encoding(false); 236new UTF8Encoding(encoderShouldEmitUTF8Identifier: false), 237new UTF8Encoding(encoderShouldEmitUTF8Identifier: true), 258new UTF8Encoding(encoderShouldEmitUTF8Identifier: true), 299new UTF8Encoding(encoderShouldEmitUTF8Identifier: true),
Text\StringTextTest_Utf8.cs (1)
19byte[] buffer = GetBytes(new UTF8Encoding(encoderShouldEmitUTF8Identifier: true), source);
Text\StringTextTest_Utf8NoBOM.cs (1)
19byte[] buffer = GetBytes(new UTF8Encoding(encoderShouldEmitUTF8Identifier: false), source);
Microsoft.CodeAnalysis.VisualBasic (1)
Compilation\DocumentationComments\DocumentationCommentCompiler.vb (1)
71writer = New StreamWriter(xmlDocStream, New UTF8Encoding(True, False), bufferSize:=&H400, leaveOpen:=True)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (2)
CommandLineTests.vb (2)
610Dim src As String = Temp.CreateFile().WriteAllText("♚", New System.Text.UTF8Encoding(False)).Path 629Dim src As String = Temp.CreateFile().WriteAllText("♚", New System.Text.UTF8Encoding(False)).Path
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (6)
PDB\PDBTests.vb (4)
44Dim tree3 = SyntaxFactory.ParseSyntaxTree("Class C" & vbCrLf & "Sub F() : End Sub : End Class", path:="Bar.vb", encoding:=New UTF8Encoding(True, False)) 45Dim tree4 = SyntaxFactory.ParseSyntaxTree(SourceText.From("Class D" & vbCrLf & "Sub F() : End Sub : End Class", New UTF8Encoding(False, False)), path:="Baz.vb") 54Dim hash3 = CryptographicHashProvider.ComputeSha1(New UTF8Encoding(True, False).GetBytesWithPreamble(tree3.ToString())).ToArray() 55Dim hash4 = CryptographicHashProvider.ComputeSha1(New UTF8Encoding(False, False).GetBytesWithPreamble(tree4.ToString())).ToArray()
PDB\VisualBasicDeterministicBuildCompilationTests.vb (2)
81End Class", fileName:="two.vb", options:=compilationOptions.ParseOptions, encoding:=New UTF8Encoding(encoderShouldEmitUTF8Identifier:=False)) 124End Class", fileName:="two.vb", options:=compilationOptions.ParseOptions, encoding:=New UTF8Encoding(encoderShouldEmitUTF8Identifier:=False))
Microsoft.CodeAnalysis.Workspaces (3)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
20private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
249s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.CodeAnalysis.Workspaces.MSBuild (3)
MSBuild\MSBuildWorkspace.cs (2)
400this.SaveDocumentText(documentId, document.FilePath, text, encoding ?? new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 418this.SaveDocumentText(documentId, document.FilePath, text, encoding ?? new UTF8Encoding(encoderShouldEmitUTF8Identifier: false));
src\Workspaces\MSBuild\BuildHost\Rpc\Contracts\JsonSettings.cs (1)
13public static readonly Encoding StreamEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
Rpc\Contracts\JsonSettings.cs (1)
13public static readonly Encoding StreamEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
249s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
VisualStudioMSBuildWorkspaceTests.cs (3)
2779Assert.Equal(new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true), text.Encoding); 2798Assert.Equal(new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true), text.Encoding); 2817Assert.Equal(new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true), text.Encoding);
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
SolutionTests\SolutionTests.cs (1)
1603var bytes = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true).GetBytes("Text");
Microsoft.DotNet.Helix.Sdk (1)
CommandPayload.cs (1)
13private static readonly Encoding s_utf8NoBom = new UTF8Encoding(false);
Microsoft.DotNet.SignCheckLibrary (3)
Verification\Jar\JarManifestFile.cs (1)
70byte[] hashValue = hashAlgorithm.ComputeHash(new UTF8Encoding().GetBytes(input.ToCharArray()));
Verification\Jar\JarManifestFileBase.cs (1)
135byte[] hashValue = hashAlgorithm.ComputeHash(new UTF8Encoding().GetBytes(ManifestText.ToCharArray()));
Verification\Jar\JarUtils.cs (1)
53byte[] hashValue = hashAlgorithm.ComputeHash(new UTF8Encoding().GetBytes(input.ToCharArray()));
Microsoft.DotNet.SourceBuild.Tasks (1)
src\WriteBuildOutputProps.cs (1)
78using (var sw = new StreamWriter(outStream, new UTF8Encoding(false)))
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (1)
ServiceClientCodeFactory.cs (1)
101public static readonly Encoding Utf8NoBom = new UTF8Encoding(false);
Microsoft.DotNet.XliffTasks (2)
Model\Document.cs (2)
17private static readonly Encoding s_utf8WithBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true); 18private static readonly Encoding s_utf8WithoutBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.Extensions.Caching.Hybrid (1)
Internal\HybridCachePayload.cs (1)
59public static UTF8Encoding Encoding { get; } = new(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false);
Microsoft.Extensions.Identity.Core (1)
Rfc6238AuthenticationService.cs (1)
18private static readonly Encoding _encoding = new UTF8Encoding(false, true);
Microsoft.ML.Core (1)
Utilities\Stream.cs (1)
803Interlocked.CompareExchange(ref _utf8NoBom, new UTF8Encoding(false), null);
PresentationBuildTasks (15)
Microsoft\Build\Tasks\Windows\MarkupCompilePass2.cs (1)
671using (StreamWriter writer = new StreamWriter(memStream, new UTF8Encoding(false)))
Microsoft\Build\Tasks\Windows\MergeLocalizationDirectives.cs (1)
62new UTF8Encoding(true)
Microsoft\Build\Tasks\Windows\UidManager.cs (1)
935UTF8Encoding encoding = new UTF8Encoding(true);
MS\Internal\Localization\LocalizationParserHooks.cs (1)
107using (XmlTextWriter writer = new XmlTextWriter(memStream, new UTF8Encoding(false)))
MS\Internal\MarkupCompiler\MarkupCompiler.cs (3)
618using (StreamWriter codeStreamWriter = new StreamWriter(codeMemStream, new UTF8Encoding(false))) 2991using (StreamWriter codeStreamWriter = new StreamWriter(codeMemStream, new UTF8Encoding(false))) 3302using (StreamWriter codeStreamWriter = new StreamWriter(codeMemStream, new UTF8Encoding(false)))
MS\Internal\Tasks\CompilerLocalReference.cs (1)
193using (StreamWriter sw = new StreamWriter(memStream, new UTF8Encoding(false)))
MS\Internal\Tasks\CompilerState.cs (1)
129using (StreamWriter sw = new StreamWriter(memStream, new UTF8Encoding(false)))
MS\Internal\Tasks\TaskFileService.cs (5)
144UTF8Encoding utf8Encoding = new UTF8Encoding(); 295UTF8Encoding utf8Encoding = new UTF8Encoding(); 308using (StreamWriter sw = new StreamWriter(destinationFile, false, new UTF8Encoding(true))) 344UTF8Encoding utf8Encoding = new UTF8Encoding(); 349using (StreamWriter sw = new StreamWriter(destinationFile, false, new UTF8Encoding(true)))
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordWriter.cs (1)
61_bamlBinaryWriter = new BamlBinaryWriter(stream,new System.Text.UTF8Encoding());
PresentationFramework (3)
MS\Internal\Controls\StickyNote\StickyNoteContentControl.cs (1)
294UTF8Encoding encoding = new UTF8Encoding();
System\Windows\Markup\BamlRecordReader.cs (1)
5391_binaryReader = new BamlBinaryReader(BamlStream, new System.Text.UTF8Encoding());
System\Windows\Markup\BamlRecordWriter.cs (1)
61_bamlBinaryWriter = new BamlBinaryWriter(stream,new System.Text.UTF8Encoding());
Roslyn.Diagnostics.Analyzers (4)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
20private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
249s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
14private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Roslyn.VisualStudio.Next.UnitTests (1)
Services\ServiceHubServicesTests.cs (1)
516var encoding = new UTF8Encoding(useBOM);
System.Diagnostics.TextWriterTraceListener (1)
System\Diagnostics\TextWriterTraceListener.cs (1)
219var noBOMwithFallback = (UTF8Encoding)new UTF8Encoding(false).Clone();
System.Formats.Asn1 (2)
System\Formats\Asn1\AsnCharacterStringEncodings.cs (2)
14private static readonly UTF8Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true); 420private static readonly UTF8Encoding s_utf8Encoding = new UTF8Encoding(false, throwOnInvalidBytes: true);
System.Formats.Cbor (2)
System\Formats\Cbor\CborConformanceLevel.cs (2)
54private static readonly UTF8Encoding s_utf8EncodingLax = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false); 55private static readonly UTF8Encoding s_utf8EncodingStrict = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
System.Formats.Nrbf (1)
System\Formats\Nrbf\NrbfDecoder.cs (1)
25private static UTF8Encoding ThrowOnInvalidUtf8Encoding { get; } = new(false, throwOnInvalidBytes: true);
System.Net.HttpListener (1)
System\Net\HttpListenerRequestUriBuilder.cs (1)
18private static readonly UTF8Encoding s_utf8Encoding = new UTF8Encoding(false, true);
System.Net.WebSockets (1)
System\Net\WebSockets\ManagedWebSocket.cs (1)
33private static readonly UTF8Encoding s_textEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
System.Private.CoreLib (3)
src\libraries\System.Private.CoreLib\src\System\IO\EncodingCache.cs (1)
10internal static readonly Encoding UTF8NoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (1)
26private static Encoding UTF8NoBOM => s_UTF8NoBOM ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.Sealed.cs (1)
34return new UTF8Encoding(_emitUTF8Identifier)
System.Private.DataContractSerialization (3)
System\Runtime\Serialization\DataContractSerializer.cs (2)
36internal static UTF8Encoding UTF8NoBom { get; } = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false); 37internal static UTF8Encoding ValidatingUTF8 { get; } = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
System\Xml\XmlExceptionHelper.cs (1)
316return CreateEncodingException(new System.Text.UTF8Encoding(false, false).GetString(buffer, offset, count), exception);
System.Private.Xml (5)
System\Xml\Core\XmlTextReaderImpl.cs (2)
22s_utf8BomThrowing ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: true, throwOnInvalidBytes: true); 3161return new UTF8Encoding(true, true);
System\Xml\Core\XmlTextReaderImplAsync.cs (1)
1015return SwitchEncodingAsync(new UTF8Encoding(true, true));
System\Xml\Serialization\Compilation.cs (1)
430byte[] info = new UTF8Encoding(true).GetBytes(codecontent);
System\Xml\Serialization\XmlSerializer.cs (1)
143private static readonly XmlWriterSettings s_writerSettings = new XmlWriterSettings() { Encoding = new UTF8Encoding(false), Indent = true };
System.Security.Cryptography (3)
src\libraries\Common\src\System\Security\Cryptography\Utf8DataEncoding.cs (1)
10internal static Encoding ThrowingUtf8Encoding { get; } = new UTF8Encoding(false, true);
System\Security\Cryptography\PasswordDeriveBytes.cs (1)
58this((new UTF8Encoding(false)).GetBytes(strPassword), rgbSalt, strHashName, iterations, cspParams) { }
System\Security\Cryptography\Rfc2898DeriveBytes.OneShot.cs (1)
13private static readonly UTF8Encoding s_throwingUtf8Encoding = new UTF8Encoding(false, true);
System.Security.Cryptography.Cose (1)
System\Security\Cryptography\Cose\CoseHelpers.cs (1)
19private static readonly UTF8Encoding s_utf8EncodingStrict = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
System.Text.Json (1)
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (1)
39public static readonly UTF8Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
System.Xaml (1)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
734return new System.Text.UTF8Encoding(true, true);
Test.Utilities (4)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
20private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
249s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
14private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Text.Analyzers (4)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
20private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
249s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
14private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
vbc (1)
src\Compilers\Shared\ConsoleUtil.cs (1)
14private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
VBCSCompiler (1)
src\Compilers\Shared\ConsoleUtil.cs (1)
14private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
VBCSCompiler.UnitTests (1)
CompilerServerTests.cs (1)
34internal static readonly UTF8Encoding UTF8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
95 references to UTF8Encoding
Aspire.Templates.Tests (1)
TemplateTestsBase.cs (1)
381UTF8Encoding utf8 = new();
dotnet-svcutil-lib (6)
FrameworkFork\System.Runtime.Serialization\System\Xml\EncodingStreamWrapper.cs (2)
23private static readonly UTF8Encoding s_safeUTF8 = new UTF8Encoding(false, false); 26private static readonly UTF8Encoding s_validatingUTF8 = new UTF8Encoding(false, true);
FrameworkFork\System.Runtime.Serialization\System\Xml\ValueHandle.cs (1)
693UTF8Encoding encoding = new UTF8Encoding(false, true);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlConverter.cs (2)
35private static UTF8Encoding s_utf8Encoding; 50private static UTF8Encoding UTF8Encoding
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlStreamNodeWriter.cs (1)
24private static UTF8Encoding s_UTF8Encoding = new UTF8Encoding(false, true);
GenerateDocumentationAndConfigFiles (1)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Metrics (1)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Metrics.Legacy (1)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.AspNetCore.DataProtection (1)
src\DataProtection\shared\src\EncodingUtil.cs (1)
11public static readonly UTF8Encoding SecureUtf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.DataProtection.Abstractions (1)
src\DataProtection\shared\src\EncodingUtil.cs (1)
11public static readonly UTF8Encoding SecureUtf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.DataProtection.Extensions (1)
src\DataProtection\shared\src\EncodingUtil.cs (1)
11public static readonly UTF8Encoding SecureUtf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.Http.Connections.Common (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.OpenApi (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (1)
SnapshotTestHelper.cs (1)
199var encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.Server.Kestrel.Core (2)
Internal\Infrastructure\HttpUtilities.cs (1)
30private static readonly UTF8Encoding DefaultRequestHeaderEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
KestrelServerOptions.cs (1)
156/// or <see langword="null"/> to use the default <see cref="UTF8Encoding"/>.
Microsoft.AspNetCore.SignalR.Common (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.WebUtilities.Tests (1)
HttpResponseStreamWriterTest.cs (1)
19var encodingWithBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
Microsoft.Build (1)
Logging\BinaryLogger\BuildEventArgsReader.cs (1)
1834var utf8noBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.Build.Engine.UnitTests (1)
Evaluation\Expander_Tests.cs (1)
1818UTF8Encoding enc = new UTF8Encoding();
Microsoft.Build.Framework (1)
EncodingUtilities.cs (1)
235if (defaultEncoding is UTF8Encoding e && e.GetPreamble().Length > 0)
Microsoft.Build.Tasks.CodeAnalysis (1)
src\Compilers\Core\MSBuildTask\GenerateMSBuildEditorConfig.cs (1)
125var encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.Build.Tasks.CodeAnalysis.Sdk (1)
src\Compilers\Core\MSBuildTask\GenerateMSBuildEditorConfig.cs (1)
125var encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.CodeAnalysis (1)
InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.CodeAnalysis.Analyzers (1)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.CodeAnalysis.CodeStyle (1)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.CodeAnalysis.CSharp (1)
Utilities\InterceptableLocation.cs (1)
54private static readonly UTF8Encoding s_encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Attributes\AttributeTests_Assembly.cs (1)
353var utf8 = new System.Text.UTF8Encoding(false, false);
Microsoft.CodeAnalysis.Extensions.Package (1)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (1)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.CodeAnalysis.PublicApiAnalyzers (1)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.CodeAnalysis.UnitTests (8)
Text\SourceTextTests.cs (5)
54var utf8NoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false); 71var utf8BOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true); 112var encodingNoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false); 113var encodingBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true); 377var utf8NoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Text\StringTextDecodingTests.cs (3)
154var utf8 = new UTF8Encoding(false, true); 188var utf8 = new UTF8Encoding(false, true); 217var encoding = new UTF8Encoding(false);
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (1)
CommandLineTests.vb (1)
3404Assert.True(TypeOf embeddedSource.Encoding Is UTF8Encoding AndAlso embeddedSource.Encoding.GetPreamble().Length = 0)
Microsoft.CodeAnalysis.Workspaces (1)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.Extensions.Caching.Hybrid (1)
Internal\HybridCachePayload.cs (1)
59public static UTF8Encoding Encoding { get; } = new(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false);
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
1114[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Text.UTF8Encoding))]
netstandard (1)
netstandard.cs (1)
2061[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Text.UTF8Encoding))]
PresentationBuildTasks (4)
Microsoft\Build\Tasks\Windows\UidManager.cs (1)
935UTF8Encoding encoding = new UTF8Encoding(true);
MS\Internal\Tasks\TaskFileService.cs (3)
144UTF8Encoding utf8Encoding = new UTF8Encoding(); 295UTF8Encoding utf8Encoding = new UTF8Encoding(); 344UTF8Encoding utf8Encoding = new UTF8Encoding();
PresentationFramework (4)
MS\Internal\Controls\StickyNote\StickyNoteContentControl.cs (1)
294UTF8Encoding encoding = new UTF8Encoding();
MS\Internal\WindowsRuntime\Generated\WinRT\GuidGenerator.cs (1)
137var data = wrt_pinterface_namespace.ToByteArray().Concat(UTF8Encoding.UTF8.GetBytes(sig)).ToArray();
System\Windows\Documents\FixedSchema.cs (1)
50if (!(base.Encoding is UTF8Encoding) && !(base.Encoding is UnicodeEncoding))
System\Windows\Markup\XamlReader.cs (1)
82Stream xamlStream = new MemoryStream(UTF8Encoding.Default.GetBytes(xamlText));
Roslyn.Diagnostics.Analyzers (1)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Roslyn.VisualStudio.Next.UnitTests (1)
Services\ServiceHubServicesTests.cs (1)
516var encoding = new UTF8Encoding(useBOM);
System.Diagnostics.TextWriterTraceListener (2)
System\Diagnostics\TextWriterTraceListener.cs (2)
219var noBOMwithFallback = (UTF8Encoding)new UTF8Encoding(false).Clone();
System.Formats.Asn1 (2)
System\Formats\Asn1\AsnCharacterStringEncodings.cs (2)
14private static readonly UTF8Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true); 420private static readonly UTF8Encoding s_utf8Encoding = new UTF8Encoding(false, throwOnInvalidBytes: true);
System.Formats.Cbor (2)
System\Formats\Cbor\CborConformanceLevel.cs (2)
54private static readonly UTF8Encoding s_utf8EncodingLax = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false); 55private static readonly UTF8Encoding s_utf8EncodingStrict = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
System.Formats.Nrbf (1)
System\Formats\Nrbf\NrbfDecoder.cs (1)
25private static UTF8Encoding ThrowOnInvalidUtf8Encoding { get; } = new(false, throwOnInvalidBytes: true);
System.IO.Ports (1)
System\IO\Ports\SerialPort.cs (1)
306if (!(value is ASCIIEncoding || value is UTF8Encoding || value is UnicodeEncoding || value is UTF32Encoding ||
System.Net.HttpListener (1)
System\Net\HttpListenerRequestUriBuilder.cs (1)
18private static readonly UTF8Encoding s_utf8Encoding = new UTF8Encoding(false, true);
System.Net.WebSockets (1)
System\Net\WebSockets\ManagedWebSocket.cs (1)
33private static readonly UTF8Encoding s_textEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
System.Private.CoreLib (7)
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (3)
80private static readonly UTF8Encoding.UTF8EncodingSealed s_defaultEncoding = new UTF8Encoding.UTF8EncodingSealed(encoderShouldEmitUTF8Identifier: false); 1038public static Encoding UTF8 => UTF8Encoding.s_default;
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (1)
406int bytesWritten = UTF8Encoding.UTF8EncodingSealed.ReadUtf8(
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.cs (2)
873GetType() != typeof(UTF8Encoding) ? new ReadOnlySpan<byte>(GetPreamble()) : // in case a derived UTF8Encoding overrode GetPreamble 879if (value is UTF8Encoding that)
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.Sealed.cs (1)
13/// A special instance of <see cref="UTF8Encoding"/> that is initialized with "don't throw on invalid sequences;
System.Private.DataContractSerialization (3)
System\Runtime\Serialization\DataContractSerializer.cs (2)
36internal static UTF8Encoding UTF8NoBom { get; } = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false); 37internal static UTF8Encoding ValidatingUTF8 { get; } = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
System\Xml\ValueHandle.cs (1)
708var encoding = DataContractSerializer.ValidatingUTF8;
System.Private.Xml (2)
System\Xml\Core\XmlTextReaderImpl.cs (2)
19private static UTF8Encoding? s_utf8BomThrowing; 21private static UTF8Encoding UTF8BomThrowing =>
System.Reflection.Metadata (4)
System\Reflection\Metadata\MetadataReader.cs (2)
67/// <exception cref="ArgumentException">The encoding of <paramref name="utf8Decoder"/> is not <see cref="UTF8Encoding"/>.</exception> 91if (!(utf8Decoder.Encoding is UTF8Encoding))
System\Reflection\Metadata\MetadataReaderProvider.cs (1)
239/// <exception cref="ArgumentException">The encoding of <paramref name="utf8Decoder"/> is not <see cref="UTF8Encoding"/>.</exception>
System\Reflection\Metadata\PEReaderExtensions.cs (1)
76/// <exception cref="ArgumentException">The encoding of <paramref name="utf8Decoder"/> is not <see cref="UTF8Encoding"/>.</exception>
System.Security.Cryptography (1)
System\Security\Cryptography\Rfc2898DeriveBytes.OneShot.cs (1)
13private static readonly UTF8Encoding s_throwingUtf8Encoding = new UTF8Encoding(false, true);
System.Security.Cryptography.Cose (1)
System\Security\Cryptography\Cose\CoseHelpers.cs (1)
19private static readonly UTF8Encoding s_utf8EncodingStrict = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
System.Text.Encoding.Extensions (1)
artifacts\obj\System.Text.Encoding.Extensions\Debug\net10.0\System.Text.Encoding.Extensions.Forwards.cs (1)
7[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Text.UTF8Encoding))]
System.Text.Json (1)
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (1)
39public static readonly UTF8Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Test.Utilities (1)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Text.Analyzers (1)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
VBCSCompiler.UnitTests (1)
CompilerServerTests.cs (1)
34internal static readonly UTF8Encoding UTF8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);