diff --git a/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx b/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx index 4f48d0181a4c79b9e51f6bcc6aece77eeb7491b6..f98789424343b4a516626a0fe6edbdc7b47436ae 100644 --- a/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx +++ b/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx @@ -1021,10 +1021,10 @@ Must complete Convert() operation or call Encoder.Reset() before calling GetBytes() or GetByteCount(). Encoder '{0}' fallback '{1}'. - The output byte buffer is too small to contain the encoded data, encoding '{0}' fallback '{1}'. + The output byte buffer is too small to contain the encoded data, encoding codepage '{0}' and fallback '{1}'. - The output char buffer is too small to contain the decoded characters, encoding '{0}' fallback '{1}'. + The output char buffer is too small to contain the decoded characters, encoding codepage '{0}' and fallback '{1}'. '{0}' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.cs index 927c1de3707b7ce3f379d26490e3f120ce5f1b7e..b236e125e73aaa76d2742b0039a9728bf0ee8c1a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.cs @@ -1140,7 +1140,7 @@ public static Stream CreateTranscodingStream(Stream innerStream, Encoding innerS // Special message to include fallback type in case fallback's GetMaxCharCount is broken // This happens if user has implemented an encoder fallback with a broken GetMaxCharCount throw new ArgumentException( - SR.Format(SR.Argument_EncodingConversionOverflowBytes, EncodingName, EncoderFallback.GetType()), "bytes"); + SR.Format(SR.Argument_EncodingConversionOverflowBytes, _codePage, EncoderFallback.GetType()), "bytes"); internal void ThrowBytesOverflow(EncoderNLS? encoder, bool nothingEncoded) { @@ -1168,7 +1168,7 @@ internal void ThrowBytesOverflow(EncoderNLS? encoder, bool nothingEncoded) // Special message to include fallback type in case fallback's GetMaxCharCount is broken // This happens if user has implemented a decoder fallback with a broken GetMaxCharCount throw new ArgumentException( - SR.Format(SR.Argument_EncodingConversionOverflowChars, EncodingName, DecoderFallback.GetType()), "chars"); + SR.Format(SR.Argument_EncodingConversionOverflowChars, _codePage, DecoderFallback.GetType()), "chars"); internal void ThrowCharsOverflow(DecoderNLS? decoder, bool nothingDecoded) {