// I just learned about "Super Quotes" a minute ago, from here:
// https://forum.arduino.cc/t/c-super-quotes-compiler-bug/990071/
//
// UTF-8 characters from here:
// https://apps.timwhitlock.info/emoji/tables/unicode
//
// Make the Serial Monitor text output larger.
// Stop the simulation when the text is written.
// Feel free to extend this test, so I can learn more.
//
// SuperQuotes.ino
// Version 1, 10 May 2022, by Koepel, Public Domain
const char normalText[] =
"This is normal text\r\n"
"Using the backslash escape character for \' and \"\r\n"
"UTF-8: € µ Ω 😁 ✅ 🌻";
const char superQuotes[] =
(R"=====(This is with Super Quotes
Everything is copied: ' " \
UTF-8: 🌷 😎 🐄 📎
Even the \t \r and \n are exactly as in the source code
Also spaces and tabs in front of the line and a new line)=====");
const char superQuotesNewLine[] =
(R"=====(
)=====");
const char superQuotesProgmem[] PROGMEM =
(R"=====(This is with Super Quotes in PROGMEM)=====");
void setup()
{
Serial.begin(115200);
Serial.print("gcc version: ");
Serial.println( F(__VERSION__));
Serial.println();
Serial.println( normalText);
Serial.println();
Serial.println( superQuotes);
Serial.println();
// The source code in wokwi has 0x0A
// Is it possible that other editors have other new lines in the source code ?
Serial.print( "A newline between Super Quotes = ");
for( int i=0; i<strlen(superQuotesNewLine); i++)
{
Serial.print("0x");
char c = superQuotesNewLine[i];
if( c < 0x10)
Serial.print( "0");
Serial.print( c, HEX);
Serial.print( ", ");
}
Serial.println();
Serial.println( "Do other editors have other new lines ?");
Serial.println();
// With PROGMEM to be able to test a large amount of text
// There is no Serial.println_P, every character is read in a for-loop.
for( int i = 0; i < strlen_P( superQuotesProgmem); i++)
{
char c = pgm_read_byte_near( superQuotesProgmem + i);
Serial.print( c);
}
Serial.println();
Serial.println();
}
void loop() {}