UTF8Encoding.GetBytes Method (String)
Encodes the characters in a specified String object into a sequence of bytes.
Assembly: mscorlib (in mscorlib.dll)
To ensure that the encoded bytes are decoded properly when they are saved as a file or as a stream, you can prefix a stream of encoded bytes with a preamble. Inserting the preamble at the beginning of a byte stream (such as at the beginning of a series of bytes to be written to a file) is the developer's responsibility. The GetBytes method does not prepend a preamble to the beginning of a sequence of encoded bytes.