Encoding::BigEndianUnicode Property

Updated: October 2010

Gets an encoding for the UTF-16 format that uses the big-endian byte order.

Namespace:  System.Text
Assembly:  mscorlib (in mscorlib.dll)

No code example is currently available or this language may not be supported.

Property Value

Type: System.Text::Encoding
An encoding for the UTF-16 format that uses the big-endian byte order.

The UnicodeEncoding object that is returned by this property may not have the appropriate behavior for your application. It uses replacement fallback to replace each string that it cannot encode and each byte that it cannot decode with a question mark ("?") character. Instead, you can call the UnicodeEncoding::UnicodeEncoding(Boolean, Boolean, Boolean) constructor to instantiate a big endian UnicodeEncoding object whose fallback is either an EncoderFallbackException or a DecoderFallbackException, as the following example illustrates.

No code example is currently available or this language may not be supported.

The returned UnicodeEncoding object has BodyName, HeaderName, and WebName properties, which yield the name "unicodeFFFE". Although the UTF-16 big endian byte order mark is hexadecimal FEFF, the name "unicodeFFFE" was chosen because the byte order mark appears as hexadecimal FFFE on little endian Windows computers.

The following example defines an array of Unicode-encoded bytes, decodes them using the GetString method, converts them to a big-endian Unicode-encoded byte array, and again decodes them using the GetString method.

No code example is currently available or this language may not be supported.

The following example determines the number of bytes required to encode a character array, encodes the characters, and displays the resulting bytes.

No code example is currently available or this language may not be supported.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Date

History

Reason

October 2010

Noted replacement fallback behavior.

Customer feedback.

Community Additions

ADD
Show: