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