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.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
Property Value
Type: System.Text.EncodingThe 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();
Show: