Encodes the specified string as a System.Text.UTF8Encoding.
- s
- The string to encode as a System.Text.UTF8Encoding.
A byte array containing the values encoded from s as a System.Text.UTF8Encoding.
Type Reason ArgumentException Error-checking is turned on for the current instance and s contains an invalid surrogate sequence. ArgumentNullException s is null.
If error-checking is turned off and an invalid surrogate sequence is detected, the invalid characters are ignored and are not encoded into the returned byte array, and no exception is thrown.
Note: This method overrides Encoding.GetBytes(Char[]).
Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0