The Nextion does not want escape characters.
Print "\ n" returns an error
Print "\ r" is not an error
Output Nextion: 0x0d 0x0a
Which is CR and LF
Is this a bug in the Nextion, or is it correct?
The Arduino can handle this very well.
Greeting and thanks
Nextion side \r is supported.
0x0D and 0x0A are not supported
"\ r" and "\ n" should both return errors due to their space
This is not a bug, what is not supported is not supported
I agree with your participation in Arduino forum
such is the proper place for Arduino issues
Again, I will reiterate Nextion use of \r is supported
and 0x0A and 0x0D is NOT supported.
Please separate these two and make distinction
0x0D is a single byte, Nextion \r is two bytes 0x5C 0x72
If you need to send either of the non-print characters "\r" or "\n" from Nextion
Then just send the hex equivalents with printh.
Nextion coding is not to be thought of as some kind of C++ extension, the compiler works in a very different way.
printh 0A will send the single byte for line feed (or "\n" as we more commonly use in C++)
printh 0D will send the single byte for carriage return (or "\r")
You can build strings using both print and printh similar to Arduino C++
is valid Nextion code.
Whole strings as Hex works too..
printh 48 65 6C 6C 6F 0A 57 6F 72 6C 64
is the equivalent of Arduino .print("Hello\nWorld");
and there are no terminating characters (0xFF 0xFF 0xFF) to deal with either, Nextion only sends what you tell it with print and printh