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
Hot Topic (More than 8 Replies) Serial Monitor doesn't display extended ASCII correctly (Read 11021 times)
Serenifly
Junior Member
**
Offline


Posts: 20
Joined: Jun 20th, 2013
Serial Monitor doesn't display extended ASCII correctly
Sep 5th, 2014 at 10:58am
Print Post  
If you add the extended ASCII Codes directly into a string, the Arduino IDE will display it correctly:
http://www.ascii-code.com/

For example:
char str[] = "\xE4";
Serial.println(str);

-> ä

However the Visual Micro Serial Monitor doesn't like this and displays a question mark instead. Probably just some encoding issue.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Monitor doesn't display extended ASCII correctly
Reply #1 - Sep 5th, 2014 at 11:17am
Print Post  
ok thanks, we will fix it in the next release
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Monitor doesn't display extended ASCII correctly
Reply #2 - Sep 7th, 2014 at 10:33pm
Print Post  
There is a fix in sp1 download

Thanks for the report
  
Back to top
IP Logged
 
Serenifly
Junior Member
**
Offline


Posts: 20
Joined: Jun 20th, 2013
Re: Serial Monitor doesn't display extended ASCII correctly
Reply #3 - Sep 8th, 2014 at 12:13pm
Print Post  
Thanks. That was quick Smiley

EDIT:
How did you test this? Now I'm getting black diamonds instead of question marks. Are there some settings in VS that could influence this?

But this isn't something that's absolutely needed. Just nice to have.
« Last Edit: Sep 8th, 2014 at 12:41pm by Serenifly »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Monitor doesn't display extended ASCII correctly
Reply #4 - Sep 8th, 2014 at 1:00pm
Print Post  
Hi,

You have to save your sketch code as utf-8 by clicking "File>Save As>With encoding" but normally when you enter unicode into your code and click the "Save" button on the tool bar or file menu then Atmel should ask you if you want to switch the encoding.

Also send me your sketch code file or a file with the characters in so I can test thanks
  
Back to top
IP Logged
 
Serenifly
Junior Member
**
Offline


Posts: 20
Joined: Jun 20th, 2013
Re: Serial Monitor doesn't display extended ASCII correctly
Reply #5 - Sep 8th, 2014 at 3:49pm
Print Post  
Wait, are we talking about the same thing?

I mean that when you send stuff with Serial.print/println and the value is above 127 it's not displayed correctly in the Serial Monitor. This doesn't have anything to do with how the source code is encoded. But it's also an encoding issue because the extended ASCII table isn't fully standardizes and there exist several code pages.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Monitor doesn't display extended ASCII correctly
Reply #6 - Sep 8th, 2014 at 4:17pm
Print Post  
Okay I switched the encoding from utf-8 to 1252 which works the same as the Arduino IDE now.

Char 128 produces a Euro symbol in both Visual Micro and the Arduino Ide

With Arduino 1.5 I used the following to see the Euro symbol

Code
Select All
Serial.write(128);
Serial.println();
 



I think I should add an encoding option to the serial monitor. With utf-8 I was able to see these characters instead of garbage.

Code
Select All
Serial.println("hello: ٨ ٩ ٪ ٫ ٬ ٭ ٮ ٯ ٰ ٱ ٲ ٳ ٴ ٵ ٶ ٷ ٸ ٹ ٺ ٻ ټ ٽ پ ٿ ڀ ځ"); 



Thanks for the hints. It's been very useful. It is important that Visual Micro works the same as the Arduino Ide out of the box.

There will be an official release for the Arduino Zero shortly so upgrade whenever you like.

Thanks again
  
Back to top
IP Logged
 
Serenifly
Junior Member
**
Offline


Posts: 20
Joined: Jun 20th, 2013
Re: Serial Monitor doesn't display extended ASCII correctly
Reply #7 - Sep 8th, 2014 at 8:08pm
Print Post  
That looks like Arabic. 128 = € seems to be correct though Smiley

It's this page:
http://www.ascii-code.com/
Which as you noted seems to be this:
http://en.wikipedia.org/wiki/Code_page_1252
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Monitor doesn't display extended ASCII correctly
Reply #8 - Sep 9th, 2014 at 1:44pm
Print Post  
Yes some Arabic text I found on web from an Arduino training company. It looked strange enough to be a reasonable test Smiley

But was not  Sad
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint