Hello forum.
I have a problem with transfer cyrillic symbols from my C# app to arduino serial. I need this to communicate with LED Display through DMD library.
Here`s arduino test sketch to understand my problem (just arduino and serial monitor):
String msg;
void setup() {
Serial.begin(9600);
}
void loop() {
if (Serial.available()>0) {
msg = Serial.readString();
Serial.println(msg);
}
}
I use different serial monitors (Atom with PlatformIO, and ASM Pro, standart arduino monitor dont work with cirillic).
I send to arduino 'ф' and get response 'ф' (In PlatformIO monitor, or ASMP I chose UTF-8 mode). All fine.
But when I'm trying to use some C# app to write and listen serial port, I always get some wrong response, like '?'. In C# app I try to use different Encoding (UTF8 not working), and it never works with cirillic (Latin symbols work correctly). I added C# app and src files (.exe in serialPusher\obj\Debug).
I try to do smth like this:
int msg1;
void setup() {
Serial.begin(9600);
}
void loop() {
if (Serial.available()>0) {
msg1 = Serial.read();
Serial.print(msg1, HEX);
}
}
If I use Serial monitors: send 'ф', get 'D184'
If I use C# app: send 'ф', get 'F4'. After some code rebuild: send 'ф', get "D184", but Serial.readString() still get '?'.
serialPusher.zip (37.2 KB)