Skip to content

Compilation Error in Arduino Code Due to Invisible Unicode Character #42

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

Closed
CarlKho-Minerva opened this issue Nov 14, 2024 · 2 comments
Closed
Assignees
Labels
conclusion: off topic Off topic for this repository topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project

Comments

@CarlKho-Minerva
Copy link

CarlKho-Minerva commented Nov 14, 2024

While using the code provided in the Arduino Pro Tutorials for BlinkRedLed_M7, I encountered a compilation error:

image
Compilation error: stray ‘\302’ in program

This error appears due to an invisible Unicode character in the comment on line 11:

digitalWrite(LEDR, HIGH); // turn the LED off by making the voltage HIGH

To fix this, you can delete the comment on line 11 and retype it, ensuring no hidden characters are present.

Steps to Reproduce

  1. Copy the code from the tutorial and paste it into the Arduino IDE.
  2. Attempt to compile.
  3. Observe the error related to the stray character \302.

Suggested Solution

Please check the code on the tutorial page for any hidden Unicode characters and remove them. Retyping the comment manually on line 11 seems to resolve the issue.

Environment

• Board: Specify board, e.g., Arduino Portenta H7
• Tutorial Link: https://docs.arduino.cc/tutorials/portenta-h7/dual-core-processing/

Additional Context:

This error can be confusing for users, especially those new to Arduino, as it’s caused by invisible characters that are not easily noticeable.

@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself topic: documentation Related to documentation for the project and removed type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Nov 14, 2024
@per1234 per1234 self-assigned this Nov 14, 2024
@per1234
Copy link
Contributor

per1234 commented Nov 15, 2024

Thanks for reporting this bug @CarlKho-Minerva!

The source files for the tutorial you linked are actually hosted in the arduino/docs-content repository. I submitted a fix for the problem in that file on your behalf: arduino/docs-content#2288

I also checked the code that is hosted in this library and determined that it does not have the same problem. Since no action is needed to resolve the issue in this repository, I'll go ahead and close this. You are welcome to review or monitor arduino/docs-content#2288 to ensure the problem you reported is fixed properly.

@per1234 per1234 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2024
@per1234 per1234 added the conclusion: off topic Off topic for this repository label Nov 15, 2024
@CarlKho-Minerva
Copy link
Author

thanks man :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: off topic Off topic for this repository topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants