-
-
Notifications
You must be signed in to change notification settings - Fork 490
#1210 Fixed highlighting of non-unicode chars in Output #1375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Closes #1210 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified this fixes #1210
Thanks Akos!
I could not develop a sketch that could reproduce the original issues
A successful compilation of any sketch will produce the original issue if Arduino CLI is using the zh locale. The reason is these problematic characters are present in the sketch memory usage report that is printed at the end of every successful compilation. The English language version looks like this:
Sketch uses 662 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes.
Unfortunately, this doesn't seem possible to achieve via the Arduino IDE 2.x "Language" preference because that sets the locale
key of arduino-cli.yaml
to zh-cn
(which is the code used by the VS Code language pack) instead of zh
.
But this sketch can also be used to reproduce it completely independently from locale:
#error ( void setup() {} void loop() {}
(screenshot is of the IDE version without the fix)
Motivation
To avoid showing a warning in the Output if an unicode character is detected as
However, I could not develop a sketch that could reproduce the original issues reported in #1210.
If I modify the Output update code and forcefully print the following invalid characters (
– )
), I can see the problem:Screen Shot 2022年08月31日 at 12 52 33
With the proposed changes, the problem goes away:
Screen Shot 2022年08月31日 at 12 54 53
Change description
Other information
Closes #1210
Reviewer checklist