Reimplemented from System.Text.Encoding.
Definition at line 386 of file ASCIIEncoding.cs.
387 {
388 if (((decoder == null) ? base.DecoderFallback : decoder.Fallback) is DecoderReplacementFallback { MaxCharCount: 1 } decoderReplacementFallback)
389 {
390 char c = decoderReplacementFallback.DefaultString[0];
391 int num = Math.Min(
bytes.Length,
chars.Length);
392 int num2 = 0;
394 {
396 {
397 while (num2 < num)
398 {
399 ptr[num2++] = c;
400 if (num2 < num)
401 {
402 num2 += (int)ASCIIUtility.WidenAsciiToUtf16(ptr2 + num2, ptr + num2, (uint)(num - num2));
403 }
404 }
405 }
406 }
409 }
411 {
412 return originalCharsLength -
chars.Length;
413 }
414 return base.GetCharsWithFallback(
bytes, originalBytesLength,
chars, originalCharsLength, decoder);
415 }
References System.bytes, System.chars, System.Text.DecoderNLS.Fallback, System.Math.Min(), and System.Text.ASCIIUtility.WidenAsciiToUtf16().
Referenced by System.Text.ASCIIEncoding.GetCharsCommon().