SerialPort::Encoding Property


Gets or sets the byte encoding for pre- and post-transmission conversion of text.

Namespace:   System.IO.Ports
Assembly:  System (in System.dll)

property Encoding^ Encoding {
	Encoding^ get();
	void set(Encoding^ value);

Property Value

Type: System.Text::Encoding^

An Encoding object. The default is ASCIIEncoding.

Exception Condition

The Encoding property was set to null.


The Encoding property was set to an encoding that is not ASCIIEncoding, UTF8Encoding, UTF32Encoding, UnicodeEncoding, one of the Windows single byte encodings, or one of the Windows double byte encodings.

.NET Framework
Available since 2.0
Return to top