Skip to content
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

[Found and solution proposed] Byte Order Mark in Espalexa.h preventing it to compile in some cases #224

Open
shimo97 opened this issue Feb 24, 2024 · 3 comments

Comments

@shimo97
Copy link

shimo97 commented Feb 24, 2024

I was experiencing a strange bug by trying to compile the library from the local project folder, the compiler wasn't recognizing the #ifndef Espalexa_h at the beginning of Espalexa.h, after running an hexdump on the file i found out that there are three corrupted bytes (EF BB BF) at the beginning of the file:
image

(EDIT: those characters seem to be UTF-8 Byte Order Mark characters)

Those characters were recognized as a special unicode charcter an the #ifndef was not seen by the compiler.

This is subtle because for some reasons the library works perfectly if included from the Arduino libraries folder but instead it doesn't work if the code is copied and included from the sketch folder or other locations.

After removing those corrupted characters everything works fine.

@HHHartmann
Copy link

That's a BOM. See here
https://en.m.wikipedia.org/wiki/Byte_order_mark
Strange though that it works in one place but not in the other.

@shimo97
Copy link
Author

shimo97 commented Feb 25, 2024

Thanks! I didn't know that, that makes more sense now.
Yes, i really don't understand why it doesn't compile in local folder but it compiles from library folder, but i tried both with 1.x and 2.x ide and neither worked, i don't know if you were also able to replicate the error...
I found someone having the same problem here, and there's also a solution posted to change the file encoding to remove those

@shimo97 shimo97 changed the title [Found and solution proposed] Binary corruption in Espalexa.h preventing it to compile in some cases [Found and solution proposed] Byte Order Mark in Espalexa.h preventing it to compile in some cases Feb 25, 2024
@shimo97
Copy link
Author

shimo97 commented Feb 25, 2024

I edited the issue to include your informations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants