TextEncoding Property
Collapse the table of content
Expand the table of content

BasicHttpBinding.TextEncoding Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets the character encoding that is used for the message text.

Namespace:  System.ServiceModel
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public Encoding TextEncoding { get; set; }

Property Value

Type: System.Text.Encoding
The Encoding that indicates the character encoding that is used. The default is UTF8Encoding.


            //Gets the character encoding for the binding
            Encoding encoding = binding.TextEncoding;
            //Output txtEncoding: System.Text.UTF8Encoding
            string txtEncoding = encoding.ToString();
            Encoding unicodeEncoding = new UnicodeEncoding();
            //Set a Unicode encoding for the binding
            binding.TextEncoding = unicodeEncoding;
            //Output txtEncoding: System.Text.UnicodeEncoding
            string txtUEncoding = binding.TextEncoding.ToString();



Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft