Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Cyrillic symbols in Visual studio (Read 7596 times)
Vitali_N
Newbies
*
Offline


Posts: 5
Location: Estonia
Joined: Feb 21st, 2017
Cyrillic symbols in Visual studio
Mar 12th, 2017 at 3:17pm
Print Post  
Hello, 
I use Windows 10 English, (Irish edition) 
I often have to use programs with Russian texts, and Windows had a problem with cyrillics, - some programs did not work, so I changed my locale settings to Russian (but kept system in English (Western European)).
Before I did not have to use strings in my experiments, but now I tried.

The issue is: compiler does not recognize the cyrillic letters in the string. 

Why I think so: It shows "?????" in the serial monitor for cyrillic String b = "АБВГД" and when I hover the cursor on latin 'A' char it shows a tip as (char)'A' but when I hover the cursor on cyrillic 'А' char it shows (char)'' as if there is nothing between apostrophes. 
The comments can be written in cyrillic and it saves and opens again without being broken, so it happens in the string compilation.

What I tried to solve it: I tried Advance saving Option to save the source file in Unicode, utf-8 with BOM, UTF-8 without signature, Cyrillic (Windows) codepage. it only changed the source cyrillic letters to other symbols but there still were no symbols in Serial monitor.

Additional notes: I also found out that for some reasons when I hover on a String type "АБВГ" it then shows the "АБВГ" in the appearing tip box, but char type 'А' shows empty it is like issue is caused by char which is also used in the String class. 

I also noticed that there in the String class are a lot of chars and unsigned chars. And I have a thought of what if the signed char cannot show symbols behind +127 (because it may  be -127 to +127) but may be I am wrong and it cannot be a reason
« Last Edit: Mar 12th, 2017 at 7:38pm by Vitali_N »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cyrillic symbols in Visual studio
Reply #1 - Mar 12th, 2017 at 9:17pm
Print Post  
Tanks for the clear post.

After upload with visual micro, what does the serial monitor in the arduino ide show?

After upload with arduino ide, what does the serial monitor in the arduino ide show?

Thanks
  
Back to top
IP Logged
 
Vitali_N
Newbies
*
Offline


Posts: 5
Location: Estonia
Joined: Feb 21st, 2017
Re: Cyrillic symbols in Visual studio
Reply #2 - Mar 12th, 2017 at 10:32pm
Print Post  
When i compile this line for Serial:
  Serial.println("АБВГ");

In Arduino IDE it shows: АБВГ
In VS VM it shows: ????????????

But one more thing I have noticed while doing this compare. 
1) Before opening in Arduino IDE my source file was saved in VS VM with UTF-8 with BOM encoding.
2) I firstly tried it in ARDUINO IDE and and it showed those above (АБВГ). So it saves everytime when compiles, so it saved.
3) next I did not close the Arduino IDE and opened the VS VM. 
Here I noticed at first in VS VM cyrillic symbols all have become broken and encoding for some very unknown reason became: Cyrillic (Windows)
  • It also asked to normalize line endings, I clicked ok to CR LF.

  • So now my serial in VS VM looked like: Serial.println("АБВГ"); instead of Serial.println("АБВГ");

  • Then I forgot to close the Arduino IDE COM Port monitor and clicked in VS VM to upload.

  • It gave an error for com port.


  • I closed the ARDUINO IDE Serial Monitor.

  • And then I decided to wait with VSVM and again uploaded in ARDUINO IDE. And miracle it showed a perfect АБВГ in Serial monitor!!! but then I reloaded it again and it began to show АБВГ again (as if VS influenced it firstly and then it was reset again)  Undecided

  • I then closed VS VM and opened again, closed Arduino serial monitor, changed the Serial.println("АБВГ"); to Serial.println("АБВГ"); and uploaded the code from VS VM, the Serial in VS VM showed ????????????



I do not understand Sad
« Last Edit: Mar 13th, 2017 at 8:57am by Vitali_N »  
Back to top
 
IP Logged
 
jirkaptr
Junior Member
**
Offline


Posts: 14
Location: CZ
Joined: Dec 14th, 2016
Re: Cyrillic symbols in Visual studio
Reply #3 - Mar 24th, 2017 at 4:57pm
Print Post  
I feel the issue is not in cyrillic but in the SerialMonitor's code page.
 
1. The idea from VM guide: "The gcc compiler that is used with Arduino supports UTF-8 encoding only".

2. In fact it is possible to create proper *.ino files in  UTF-8 (... and compiler processes the file without objection)

3. Chrome store suggests "Serial Projector" from amperka.ru / see https://chrome.google.com/webstore/detail/serial-projector/kbkjgbkmphnikcpkcodjb.... This serial monitor gives evidence that Arduino sends UTF-8 codings correctly. (Including cyrillic)

4. VisualMicro noted in Release (1412.10) - 10th December 2014: 
"Serial Monitor Encoding switched from utf-8 to 1252" and below it notes "mod: Serial viewer encoding from ascii to utf-8" too. (???)

VS's and ARDUINO's Serial monitors does not work for me with non-ASCII characters, although ARDUINO these characters sends. It is proven by Serial Projector.

What is the reason? How to avoid this?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cyrillic symbols in Visual studio
Reply #4 - Mar 24th, 2017 at 5:08pm
Print Post  
Sorry for the delayed response. Yes it's certainly the serial causing ????. Actually I think it is the windows Serial.read where visual micro might be able to change the code page. Some testing is planned for the next week or two so hopefully we find a solution.

I agree that files must also be saved as UTF-8, I think that's an option on the visual studio "save as" dialog. I expect the default is ansi.

I also want to look at the temp .cpp that visual micro builds from the .ino files to ensure that uses utf-8
« Last Edit: Mar 24th, 2017 at 5:09pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cyrillic symbols in Visual studio
Reply #5 - Mar 25th, 2017 at 4:08pm
Print Post  
This is resolved in 1703.25 sp1. It isn't in the gallery yet.

Can be downloaded from here

Thanks for the report and the help.

info

The reader will now read utf8 correctly in the serial monitor

Source code doesn't start off as utf8 at the moment. Use "File>Save As>With Encoding" to change the coding of source code where required.
  
Back to top
IP Logged
 
Vitali_N
Newbies
*
Offline


Posts: 5
Location: Estonia
Joined: Feb 21st, 2017
Re: Cyrillic symbols in Visual studio
Reply #6 - Mar 26th, 2017 at 11:38pm
Print Post  
Hello Pros,

I also wanted to write more info, but my SSD crashed with a redundancy check error, so I lost all of my experiment projects and could not retrieve it back(. 

Thank you for continuing the thread. My return back will take some time.

I am now temporarily using environment of Visual Studio 2017 with a free VM version.

by the way Visual Micro I read the posts and I could add that this was not only in the Serial, chars in Arduino IDE and in VS VM also were read differently. In Arduino IDE there were broken symbols but in VS VM it seemed as if chars were empty. But I need to revive what I did.

I have downloaded the version that you have put here. and will test but not sure that very soon.
  
Back to top
 
IP Logged
 
jirkaptr
Junior Member
**
Offline


Posts: 14
Location: CZ
Joined: Dec 14th, 2016
Re: Cyrillic symbols in Visual studio
Reply #7 - Mar 30th, 2017 at 5:20pm
Print Post  
Thanks, Tim. It works now (like never before...) Cheesy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint