39 references to SupportedEncoding
System.Private.DataContractSerialization (39)
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (39)
27private SupportedEncoding _encodingCode; 128SupportedEncoding expectedEnc = GetSupportedEncoding(encoding); 129SupportedEncoding dataEnc; 132dataEnc = SupportedEncoding.UTF8; 138if ((expectedEnc != SupportedEncoding.None) && (expectedEnc != dataEnc)) 144if (dataEnc == SupportedEncoding.UTF8) 180if (_encodingCode == SupportedEncoding.UTF8) 225if (_byteCount == 0 && _encodingCode == SupportedEncoding.UTF8) 255if (_encodingCode == SupportedEncoding.UTF8) 276if (_encodingCode == SupportedEncoding.UTF8) 285private static Encoding GetEncoding(SupportedEncoding e) => 288SupportedEncoding.UTF8 => DataContractSerializer.ValidatingUTF8, 289SupportedEncoding.UTF16LE => DataContractSerializer.ValidatingUTF16, 290SupportedEncoding.UTF16BE => DataContractSerializer.ValidatingBEUTF16, 294private static string GetEncodingName(SupportedEncoding enc) => 297SupportedEncoding.UTF8 => "utf-8", 298SupportedEncoding.UTF16LE => "utf-16LE", 299SupportedEncoding.UTF16BE => "utf-16BE", 303private static SupportedEncoding GetSupportedEncoding(Encoding? encoding) 307return SupportedEncoding.None; 311return SupportedEncoding.UTF8; 315return SupportedEncoding.UTF16LE; 319return SupportedEncoding.UTF16BE; 327private static SupportedEncoding ReadEncoding(byte b1, byte b2) 331return SupportedEncoding.UTF16BE; 336return SupportedEncoding.UTF16LE; 345return SupportedEncoding.UTF8; 349private static void ThrowExpectedEncodingMismatch(SupportedEncoding expEnc, SupportedEncoding actualEnc) 375if (_encodingCode == SupportedEncoding.UTF16LE) 435SupportedEncoding expectedEnc = GetSupportedEncoding(expectedEncoding); 436SupportedEncoding dataEnc = ReadEncoding(); 437if ((expectedEnc != SupportedEncoding.None) && (expectedEnc != dataEnc)) 443if (dataEnc != SupportedEncoding.UTF8) 470if (_encodingCode != SupportedEncoding.UTF8) 478private SupportedEncoding ReadEncoding() 485SupportedEncoding e; 489e = SupportedEncoding.UTF8; 494e = SupportedEncoding.UTF8;