CharSet Enumeration

Microsoft Silverlight will reach end of support after October 2021. Learn more.

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Dictates which character set marshaled strings should use.

Namespace:  System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
<ComVisibleAttribute(True)> _
Public Enumeration CharSet
[ComVisibleAttribute(true)]
public enum CharSet

Members

Member name Description
None This value is obsolete and has the same behavior as CharSet.Ansi.
Ansi Marshal strings as multiple-byte character strings.
Supported by Silverlight for Windows PhoneSupported by Xbox 360 Unicode Marshal strings as Unicode 2-byte characters.
Supported by Silverlight for Windows PhoneSupported by Xbox 360 Auto Automatically marshal strings appropriately for the target operating system. The default is Unicode on Windows NT, Windows 2000, Windows XP, and the Windows Server 2003 family; the default is Ansi on Windows 98 and Windows Me. Although the common language runtime default is Auto, languages may override this default. For example, by default C# marks all methods and types as Ansi.

Version Information

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

Platforms

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