Add note on UTF8Encoding.GetByteCount to EncodingForwarder
authorJames Ko <jamesqko@gmail.com>
Tue, 5 Jul 2016 00:20:43 +0000 (20:20 -0400)
committerJames Ko <jamesqko@gmail.com>
Tue, 5 Jul 2016 00:20:43 +0000 (20:20 -0400)
Commit migrated from https://github.com/dotnet/coreclr/commit/a4192dc80352345be2c250b4c33b5b72680069d6

src/coreclr/src/mscorlib/src/System/Text/EncodingForwarder.cs

index abf21d8..e0d6986 100644 (file)
@@ -64,6 +64,7 @@ namespace System.Text
             if (s == null)
             {
                 string paramName = encoding is ASCIIEncoding ? "chars" : "s"; // ASCIIEncoding calls the string chars
+                // UTF8Encoding does this as well, but it originally threw an ArgumentNull for "s" so don't check for that
                 throw new ArgumentNullException(paramName);
             }
             Contract.EndContractBlock();