Printing Extended ASCII characters in a String by the Serial Monitor

Hello Arduino Comunity!

Please, I can't find a way to print correctly some strings by the serial connection over the 128-ASCII character, like this:

void setup()
{
Serial.begin(9600);
}

void loop()
{
Serial.println("Atenção");
for(;;);
}

When I try to print a string that contains "ç", "ã" or something there`s no in english language I receive at my Serial Monitor something distorted.

How can I do it right?
Is there any library for this?

Printing Extended ASCII characters in a String by the Serial Monitor

You don't have a String (count your lucky stars), so no worries, eh?

How can I do it right?

You assume that you can. I don't know that that is a valid assumption. You can print non-standard ASCII characters (some of them, anyway), using the \nnn notation, where nnn is the extended ASCII character that you want to print.

Hello and welcome :slight_smile:

You can solve this problem by opening the preferences.txt file:

  • In the Arduino IDE, go in Files -> Preferences
  • At the bottom of the Preference window you have a link to the preferences.txt file
  • Click it to open the file, then close the IDE
  • In preferences.txt, find setting preproc.substitute_unicode and change it's value from true to false
  • Save it, re open IDE, upload your sketch and it should work now

At least it did for me :wink:

OW! Thank you so much guix! with your hint my program worked really perfect now!

Thanks for your welcome, i'm really a newbie in Arduino World like my status says! =p