Skip to content

Replace non-breaking space characters in code snippets #2288

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

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Nov 15, 2024

What This PR Changes

Some of the sketch code was littered with random use of the non-breaking space character in place of standard space characters. Although the two characters appear the same to a human, they are not the same to the compiler, and so cause spurious errors when the sketch was compiled:

sketch_nov15a.ino:3:1: error: stray '\302' in program
     // initialize digital pin LEDR as an output.
 ^
sketch_nov15a.ino:3:2: error: stray '\240' in program
     // initialize digital pin LEDR as an output.
  ^

exit status 1

Compilation error: stray '\302' in program

The solution is to replace these invalid characters with standard spaces

Additional Context

Originally reported by @CarlKho-Minerva at arduino-libraries/Arduino_Pro_Tutorials#42

Contribution Guidelines

Some of the sketch code was littered with random use of the non-breaking space character in place of standard space characters. Although the two characters appear the same to a human, they are not the same to the compiler, and so cause spurious errors when the sketch was compiled:

```
sketch_nov15a.ino:3:1: error: stray '\302' in program
     // initialize digital pin LEDR as an output.
 ^
sketch_nov15a.ino:3:2: error: stray '\240' in program
     // initialize digital pin LEDR as an output.
  ^

exit status 1

Compilation error: stray '\302' in program
```

The solution is to replace these invalid characters with standard spaces
@per1234 per1234 merged commit ad6f86a into arduino:main Nov 15, 2024
4 checks passed
@per1234 per1234 deleted the fix-stray-errors branch November 15, 2024 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arduino Bugs and fixes added by the Arduino Team bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants