UnicodeEncoding Constructor ()
Initializes a new instance of the UnicodeEncoding class.
Assembly: mscorlib (in mscorlib.dll)
This constructor creates an instance that uses the little endian byte order, provides a Unicode byte order mark, and does not throw an exception when an invalid encoding is detected.
Note |
|---|
For security reasons, you should enable error detection by calling the UnicodeEncoding(Boolean, Boolean, Boolean) constructor and setting its throwOnInvalidBytes argument to true. |
The following example demonstrates how to create a new UnicodeEncoding instance and display the name of the encoding.
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
