1 type derived from UTF8Encoding
System.Private.CoreLib (1)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.Sealed.cs (1)
17internal sealed class UTF8EncodingSealed : UTF8Encoding
217 instantiations of UTF8Encoding
aspire (5)
Agents\Hooks\TelemetryHookInstaller.cs (1)
23private static readonly UTF8Encoding s_utf8NoBom = new(encoderShouldEmitUTF8Identifier: false);
Processes\IsolatedProcess.cs (2)
380StandardOutputEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false), 381StandardErrorEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false),
Processes\IsolatedProcess.Windows.cs (1)
127var encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false);
Templating\CliTemplateFactory.cs (1)
348await using var writer = new StreamWriter(fileStream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false));
Aspire.Hosting (1)
ContainerResourceBuilderExtensions.cs (1)
1745var utf8WithoutBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Aspire.Hosting.Dotnet (2)
DotnetProjectBuildEnvironmentCallbackAnnotation.cs (1)
55var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false));
DotnetProjectBuildResource.cs (1)
222Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false),
Aspire.Hosting.Radius (1)
Secrets\SealedSecretManifest.cs (1)
36private static readonly UTF8Encoding s_utf8 = new(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Aspire.Hosting.Rust (1)
RustHostingExtensions.cs (1)
839new UTF8Encoding(encoderShouldEmitUTF8Identifier: false),
Aspire.Hosting.Tests (19)
ApplicationModel\Docker\DockerfileBuilderEdgeCasesTests.cs (7)
21using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 38using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 70using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 95using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 124using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 181using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 224using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false));
ApplicationModel\Docker\DockerfileBuilderIntegrationTests.cs (2)
33using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 108using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false));
ApplicationModel\Docker\DockerfileBuilderTests.cs (3)
123using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 162using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 206using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false));
ApplicationModel\Docker\DockerfileStageTests.cs (7)
319using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 353using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 389using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 420using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 462using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 520using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 555using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false));
Aspire.Templates.Tests (1)
TemplateTestsBase.cs (1)
372UTF8Encoding utf8 = new();
csc (1)
src\roslyn\src\Compilers\Shared\ConsoleUtil.cs (1)
14private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
dotnet-aot (2)
parent\dotnet\Commands\Solution\Remove\SolutionRemoveCommand.cs (1)
77Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true)
parent\dotnet\Commands\Test\MTP\TestApplication.cs (1)
476using (var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)))
dotnet-format (2)
Formatters\CharsetFormatter.cs (1)
16private static Encoding Utf8 => new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Workspaces\FolderWorkspace.cs (1)
13private static Encoding DefaultEncoding => 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\roslyn\src\Compilers\Core\Portable\EncodedStringText.cs (1)
23private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
252s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
14private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
src\roslyn\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);
ILCompiler.Compiler (1)
Compiler\MetadataManager.cs (1)
810var noThrowUtf8Encoding = new UTF8Encoding(false, false);
ILCompiler.MetadataTransform (1)
parent\parent\Common\Internal\NativeFormat\NativeFormatWriter.cs (1)
199private static readonly UTF8Encoding s_stringEncoding = new UTF8Encoding(false, false);
ILCompiler.ReadyToRun (2)
parent\parent\Common\Internal\NativeFormat\NativeFormatWriter.cs (1)
199private static readonly UTF8Encoding s_stringEncoding = new UTF8Encoding(false, false);
PortableCallHelpers\PortableCallHelpersGenerator.cs (1)
153File.WriteAllText(path, content, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false));
Infrastructure.Tests (1)
PowerShellScripts\AspireSkillsBundleHashTests.cs (1)
168var utf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.Components.Server (1)
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\StringEncoding.cs (1)
14internal static readonly Encoding UTF8 = new UTF8Encoding(false);
Microsoft.AspNetCore.DataProtection (1)
parent\parent\shared\src\EncodingUtil.cs (1)
11public static readonly UTF8Encoding SecureUtf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.DataProtection.Abstractions (1)
parent\parent\shared\src\EncodingUtil.cs (1)
11public static readonly UTF8Encoding SecureUtf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.DataProtection.Extensions (1)
parent\parent\shared\src\EncodingUtil.cs (1)
11public static readonly UTF8Encoding SecureUtf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.Diagnostics (1)
src\aspnetcore\src\Shared\RazorViews\BaseView.cs (1)
21private static readonly Encoding UTF8NoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
src\aspnetcore\src\Shared\RazorViews\BaseView.cs (1)
21private static readonly Encoding UTF8NoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.Hosting (1)
src\aspnetcore\src\Shared\RazorViews\BaseView.cs (1)
21private static readonly Encoding UTF8NoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.Http.Connections.Common (1)
src\aspnetcore\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.Mvc.Core (1)
Formatters\TextInputFormatter.cs (1)
19= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.OpenApi (1)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.Server.HttpSys (2)
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
17private static readonly Encoding UTF8 = new UTF8Encoding(
src\aspnetcore\src\Shared\ServerInfrastructure\StringUtilities.cs (1)
97new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetByteCount(value);
Microsoft.AspNetCore.Server.IIS (3)
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
17private static readonly Encoding UTF8 = new UTF8Encoding(
src\aspnetcore\src\Shared\RazorViews\BaseView.cs (1)
21private static readonly Encoding UTF8NoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\aspnetcore\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\aspnetcore\src\Shared\ServerInfrastructure\StringUtilities.cs (1)
97new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetByteCount(value);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
src\aspnetcore\src\Shared\ServerInfrastructure\StringUtilities.cs (1)
97new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetByteCount(value);
Microsoft.AspNetCore.SignalR.Common (1)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.Build (3)
Logging\BinaryLogger\BuildEventArgsReader.cs (1)
1895var utf8noBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Logging\FileLogger.cs (1)
276private Encoding _encoding = new UTF8Encoding(false);
Xml\XmlReaderExtension.cs (1)
30private static readonly Encoding s_utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.Build.Framework (1)
EncodingUtilities.cs (1)
28internal static readonly Encoding Utf8WithoutBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.Build.Tasks.CodeAnalysis (1)
src\roslyn\src\Compilers\Core\MSBuildTask\GenerateMSBuildEditorConfig.cs (1)
132var encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.Build.Tasks.Core (3)
FileIO\WriteLinesToFile.cs (1)
22private static readonly Encoding s_defaultEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
GenerateResource.cs (1)
3643using (LineNumberStreamReader sr = new LineNumberStreamReader(fs, new UTF8Encoding(true), true))
parent\Shared\LanguageParser\StreamMappedString.cs (1)
121Encoding utf8Encoding = new UTF8Encoding(false, true /* throw on illegal bytes */);
Microsoft.Build.Tasks.Git (1)
GitDataReader\GitRefTableReader.cs (1)
19private static readonly Encoding s_utf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.CodeAnalysis (4)
EncodedStringText.cs (1)
23private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
InternalUtilities\StringExtensions.cs (1)
252s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Text\SourceText.cs (1)
50private static readonly Encoding s_utf8EncodingWithNoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false);
Text\SourceTextStream.cs (1)
35private static readonly Encoding s_utf8EncodingWithNoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false);
Microsoft.CodeAnalysis.Analyzers (4)
src\roslyn\src\Compilers\Core\Portable\EncodedStringText.cs (1)
23private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
252s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
14private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.CodeAnalysis.AnalyzerUtilities (4)
src\roslyn\src\Compilers\Core\Portable\EncodedStringText.cs (1)
23private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
252s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
14private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.CodeAnalysis.CodeStyle (3)
src\roslyn\src\Compilers\Core\Portable\EncodedStringText.cs (1)
23private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
252s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\roslyn\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)
93encoding: 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.Workspaces (1)
SyncedSource\FileBasedPrograms\FileLevelDirectiveHelpers.cs (1)
249var encoding = Text.Encoding ?? new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.CodeAnalysis.Extensions.Package (1)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
252s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.CodeAnalysis.NetAnalyzers (1)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
13private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
Microsoft.CodeAnalysis.ResxSourceGenerator (4)
src\roslyn\src\Compilers\Core\Portable\EncodedStringText.cs (1)
23private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
252s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
14private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.CodeAnalysis.VisualBasic (1)
Compilation\DocumentationComments\DocumentationCommentCompiler.vb (1)
71writer = New StreamWriter(xmlDocStream, New UTF8Encoding(True, False), bufferSize:=&H400, leaveOpen:=True)
Microsoft.CodeAnalysis.Workspaces (3)
src\roslyn\src\Compilers\Core\Portable\EncodedStringText.cs (1)
23private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
252s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\MSBuildWorkspace.cs (2)
425this.SaveDocumentText(documentId, document.FilePath, text, encoding ?? new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 443this.SaveDocumentText(documentId, document.FilePath, text, encoding ?? new UTF8Encoding(encoderShouldEmitUTF8Identifier: false));
Microsoft.CodeAnalysis.Workspaces.MSBuild.Contracts (1)
JsonSettings.cs (1)
15public static readonly Encoding StreamEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.Diagnostics.DataContractReader (2)
ContractDescriptorTarget.cs (2)
80private static readonly UTF8Encoding strictUTF8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true); 81private static readonly UTF8Encoding looseUTF8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false);
Microsoft.DotNet.ApiCompatibility (1)
Logging\SuppressionEngine.cs (1)
136Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false), // UTF-8, no BOM
Microsoft.DotNet.Build.Tasks.Templating (1)
GenerateFileFromTemplate.cs (1)
93byte[] resultBytes = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false).GetBytes(result);
Microsoft.DotNet.ProjectTools (1)
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\FileLevelDirectiveHelpers.cs (1)
249var encoding = Text.Encoding ?? new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.DotNet.SourceBuild.Tasks (1)
src\WriteBuildOutputProps.cs (1)
87using (var sw = new StreamWriter(outStream, 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);
Microsoft.NET.HostModel (1)
ComHost\RegFreeComManifest.cs (1)
46Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)
Microsoft.NET.ProjectData (3)
ProjectDataBuildDiagnosticProtocol.cs (1)
19 private static readonly Encoding Utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
ProjectDataBuildReceipt.cs (1)
19 private static readonly Encoding Utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
UnsupportedProjectDataMarker.cs (1)
20 private static readonly Encoding Utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.NET.ProjectData.Tasks (5)
ProjectDataBuildCompletionLogger.cs (1)
22 private static readonly Encoding Utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
ProjectDataWriter.cs (1)
338 internal static readonly UTF8Encoding Utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
src\roslyn\src\ProjectData\Microsoft.NET.ProjectData\ProjectDataBuildDiagnosticProtocol.cs (1)
19 private static readonly Encoding Utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
src\roslyn\src\ProjectData\Microsoft.NET.ProjectData\ProjectDataBuildReceipt.cs (1)
19 private static readonly Encoding Utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
src\roslyn\src\ProjectData\Microsoft.NET.ProjectData\UnsupportedProjectDataMarker.cs (1)
20 private static readonly Encoding Utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.TestPlatform.PlatformAbstractions (1)
common\Tracing\RollingFileTraceListener.cs (1)
106Encoding encoding = (Encoding)new UTF8Encoding(false).Clone();
Microsoft.VisualStudio.TestPlatform.Extensions.TestIds.TestLogger (1)
TestIdsLogger.cs (1)
319new UTF8Encoding(encoderShouldEmitUTF8Identifier: true)))
NuGet.Build.Tasks (1)
StaticGraphRestoreTaskBase.cs (1)
113Encoding utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
NuGet.Build.Tasks.Console (1)
Program.cs (1)
207using var reader = new BinaryReader(getStream(), new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true), leaveOpen: true);
NuGet.Packaging (8)
PackageArchiveReader.cs (3)
394using (var reader = new BinaryReader(bufferedStream, new UTF8Encoding(), leaveOpen: true)) 446using (var reader = new BinaryReader(bufferedStream, new UTF8Encoding(), leaveOpen: true)) 567using (var reader = new BinaryReader(bufferedStream, new UTF8Encoding(), leaveOpen: true))
Signing\Package\SignedPackageArchive.cs (4)
55using (var reader = new BinaryReader(ZipReadStream, new UTF8Encoding(), leaveOpen: true)) 58new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true), 93using (var reader = new BinaryReader(bufferedStream, new UTF8Encoding(), leaveOpen: true)) 104using (var reader = new BinaryReader(bufferedStream, new UTF8Encoding(), leaveOpen: true))
Signing\Specifications\SigningSpecificationsV1.cs (1)
14private static readonly Encoding _encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
NuGet.Protocol (3)
Plugins\PluginFactory.cs (3)
191StandardOutputEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false), 205StandardOutputEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false), 341var encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
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)
605using (StreamWriter codeStreamWriter = new StreamWriter(codeMemStream, new UTF8Encoding(false))) 2978using (StreamWriter codeStreamWriter = new StreamWriter(codeMemStream, new UTF8Encoding(false))) 3289using (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\wpf\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\roslyn\src\Compilers\Core\Portable\EncodedStringText.cs (1)
23private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
252s_lazyUtf8 ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\AdditionalTextExtensions.cs (1)
14private static readonly Encoding s_utf8bom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: true);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (1)
34private static readonly Encoding s_encodingUtf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
sdk-tasks (1)
IncrementalLayout.cs (1)
247File.WriteAllText(temporaryPath, contents, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false));
System.Diagnostics.TextWriterTraceListener (1)
System\Diagnostics\TextWriterTraceListener.cs (1)
219var noBOMwithFallback = (UTF8Encoding)new UTF8Encoding(false).Clone();
System.DirectoryServices.Protocols (8)
System\DirectoryServices\Protocols\common\BerConverter.cs (2)
18UTF8Encoding utf8Encoder = new UTF8Encoding(); 308UTF8Encoding utf8Encoder = new UTF8Encoding(false, true);
System\DirectoryServices\Protocols\common\DirectoryAttribute.cs (2)
16private static readonly UTF8Encoding s_utf8EncoderWithErrorDetection = new UTF8Encoding(false, true); 18private static readonly UTF8Encoding s_encoder = new UTF8Encoding();
System\DirectoryServices\Protocols\common\DirectoryControl.cs (1)
104internal static readonly UTF8Encoding s_utf8Encoding = new(false, true);
System\DirectoryServices\Protocols\ldap\LdapConnection.cs (3)
592var encoder = new UTF8Encoding(); 597var encoder = new UTF8Encoding(); 1242var encoder = new UTF8Encoding();
System.Formats.Asn1 (2)
System\Formats\Asn1\AsnCharacterStringEncodings.cs (2)
11private static readonly UTF8Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true); 367private 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\runtime\src\libraries\System.Private.CoreLib\src\System\IO\EncodingCache.cs (1)
10internal static readonly Encoding UTF8NoBOM = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\File.cs (1)
25private static Encoding UTF8NoBOM => field ??= new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
src\runtime\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)
431byte[] 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\runtime\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.ServiceModel.Http (1)
System\ServiceModel\Channels\HttpChannelFactory.cs (1)
675byte[] inputBytes = new UTF8Encoding().GetBytes(inputString);
System.ServiceModel.Primitives (2)
System\IdentityModel\Tokens\WSSecurityJan2004.cs (2)
306bytes = new UTF8Encoding().GetBytes(reader.ReadContentAsString()); 346writer.WriteString(new UTF8Encoding().GetString(keyIdentifier, 0, keyIdentifier.Length));
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\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
734return new System.Text.UTF8Encoding(true, true);
vbc (1)
src\roslyn\src\Compilers\Shared\ConsoleUtil.cs (1)
14private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
VBCSCompiler (1)
src\roslyn\src\Compilers\Shared\ConsoleUtil.cs (1)
14private static readonly Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
94 references to UTF8Encoding
aspire (2)
Agents\Hooks\TelemetryHookInstaller.cs (1)
23private static readonly UTF8Encoding s_utf8NoBom = new(encoderShouldEmitUTF8Identifier: false);
Processes\IsolatedProcess.Windows.cs (1)
127var encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false);
Aspire.Hosting (1)
ContainerResourceBuilderExtensions.cs (1)
1745var utf8WithoutBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Aspire.Hosting.Radius (1)
Secrets\SealedSecretManifest.cs (1)
36private static readonly UTF8Encoding s_utf8 = new(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Aspire.Templates.Tests (1)
TemplateTestsBase.cs (1)
372UTF8Encoding 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\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
ILCompiler.Compiler (1)
Compiler\MetadataManager.cs (1)
810var noThrowUtf8Encoding = new UTF8Encoding(false, false);
ILCompiler.MetadataTransform (1)
parent\parent\Common\Internal\NativeFormat\NativeFormatWriter.cs (1)
199private static readonly UTF8Encoding s_stringEncoding = new UTF8Encoding(false, false);
ILCompiler.ReadyToRun (1)
parent\parent\Common\Internal\NativeFormat\NativeFormatWriter.cs (1)
199private static readonly UTF8Encoding s_stringEncoding = new UTF8Encoding(false, false);
Infrastructure.Tests (1)
PowerShellScripts\AspireSkillsBundleHashTests.cs (1)
168var utf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.DataProtection (1)
parent\parent\shared\src\EncodingUtil.cs (1)
11public static readonly UTF8Encoding SecureUtf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.DataProtection.Abstractions (1)
parent\parent\shared\src\EncodingUtil.cs (1)
11public static readonly UTF8Encoding SecureUtf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.DataProtection.Extensions (1)
parent\parent\shared\src\EncodingUtil.cs (1)
11public static readonly UTF8Encoding SecureUtf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.AspNetCore.Http.Connections.Common (1)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.OpenApi (1)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
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)
162/// or <see langword="null"/> to use the default <see cref="UTF8Encoding"/>.
Microsoft.AspNetCore.SignalR.Common (1)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
16private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.Build (1)
Logging\BinaryLogger\BuildEventArgsReader.cs (1)
1895var utf8noBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.Build.Framework (1)
EncodingUtilities.cs (1)
240if (defaultEncoding is UTF8Encoding e && e.GetPreamble().Length > 0)
Microsoft.Build.Tasks.CodeAnalysis (1)
src\roslyn\src\Compilers\Core\MSBuildTask\GenerateMSBuildEditorConfig.cs (1)
132var encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
Microsoft.CodeAnalysis (1)
InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.CodeAnalysis.Analyzers (1)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.CodeAnalysis.CodeStyle (1)
src\roslyn\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.Extensions.Package (1)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.CodeAnalysis.Workspaces (1)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
Microsoft.Diagnostics.DataContractReader (2)
ContractDescriptorTarget.cs (2)
80private static readonly UTF8Encoding strictUTF8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true); 81private static readonly UTF8Encoding looseUTF8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false);
Microsoft.DotNet.TemplateLocator (1)
parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.GlobalJsonReader.cs (1)
33if (streamReader.CurrentEncoding is UTF8Encoding)
Microsoft.Extensions.Caching.Hybrid (1)
Internal\HybridCachePayload.cs (1)
59public static UTF8Encoding Encoding { get; } = new(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false);
Microsoft.NET.Build.Tasks (1)
parent\parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.GlobalJsonReader.cs (1)
33if (streamReader.CurrentEncoding is UTF8Encoding)
Microsoft.NET.ProjectData.Tasks (1)
ProjectDataWriter.cs (1)
338 internal static readonly UTF8Encoding Utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
Microsoft.NET.Sdk.WorkloadManifestReader (1)
SdkDirectoryWorkloadManifestProvider.GlobalJsonReader.cs (1)
33if (streamReader.CurrentEncoding is UTF8Encoding)
mscorlib (1)
parent\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))]
NuGet.Protocol (1)
Plugins\PluginFactory.cs (1)
341var encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
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\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
21private static UTF8Encoding? s_lazyUtf8;
System.Diagnostics.TextWriterTraceListener (2)
System\Diagnostics\TextWriterTraceListener.cs (2)
219var noBOMwithFallback = (UTF8Encoding)new UTF8Encoding(false).Clone();
System.DirectoryServices.Protocols (8)
System\DirectoryServices\Protocols\common\BerConverter.cs (2)
18UTF8Encoding utf8Encoder = new UTF8Encoding(); 308UTF8Encoding utf8Encoder = new UTF8Encoding(false, true);
System\DirectoryServices\Protocols\common\DirectoryAttribute.cs (2)
16private static readonly UTF8Encoding s_utf8EncoderWithErrorDetection = new UTF8Encoding(false, true); 18private static readonly UTF8Encoding s_encoder = new UTF8Encoding();
System\DirectoryServices\Protocols\common\DirectoryControl.cs (1)
104internal static readonly UTF8Encoding s_utf8Encoding = new(false, true);
System\DirectoryServices\Protocols\ldap\LdapConnection.cs (3)
592var encoder = new UTF8Encoding(); 597var encoder = new UTF8Encoding(); 1242var encoder = new UTF8Encoding();
System.Formats.Asn1 (2)
System\Formats\Asn1\AsnCharacterStringEncodings.cs (2)
11private static readonly UTF8Encoding s_utf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true); 367private 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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (1)
406int bytesWritten = UTF8Encoding.UTF8EncodingSealed.ReadUtf8(
src\runtime\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\runtime\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)
src\runtime\artifacts\obj\System.Text.Encoding.Extensions\Release\net11.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);