I want to encode my string before send it to serial port using like this:
SerialPort port = new SerialPort(portName, baudRate, Parity.None, 8, StopBits.One);
port.DtrEnable = true;
Encoding encode = Encoding.GetEncoding("VISCII");
port.Encoding = encode;
With VISCII is my language Code page. Of course, I get the exception in this case because it's not supported.
How can I do this? Any answer would be appreciated! Thanks so much
Here there is a (not-so) simple VISCII encoding/encoder/decoder:
use it like:
It is based on the table in http://en.wikipedia.org/wiki/Vietnamese_Standard_Code_for_Information_Interchange
Note that this is my first
Encoder
/Decoder
subclass, so I'm not 100% sure I did everything as it should be done :-)In your case, you should be able to pass directly as: