EncodingUtil.cs 506 B

1234567891011121314
  1. // Copyright (c) .NET Foundation. All rights reserved.
  2. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
  3. using System;
  4. using System.Text;
  5. namespace Microsoft.AspNetCore.DataProtection
  6. {
  7. internal static class EncodingUtil
  8. {
  9. // UTF8 encoding that fails on invalid chars
  10. public static readonly UTF8Encoding SecureUtf8Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
  11. }
  12. }