Skip to content

IDE doesn't properly handle byte order mark #2092

@McNeight

Description

@McNeight

http://en.wikipedia.org/wiki/Byte_order_mark
The UTF-8 representation of the BOM is the byte sequence 0xEF, 0xBB, 0xBF. A text editor or web browser interpreting the text as ISO-8859-1 or CP1252 will display the characters  for this.

Adding the byte order mark to a UTF-8 encoded library.properties file causes that library to be ignored by the IDE. Removing the three bytes at the beginning of the file "restores" the library.

Adding the byte order mark to a UTF-8 encoded header file causes the following compilation error:

In file included from ReceiveJ1939Messages.ino:28:
C:\Users\mcneightne\Documents\Arduino\libraries\CAN_Library\src/CAN.h:1: error: stray '\357' in program
C:\Users\mcneightne\Documents\Arduino\libraries\CAN_Library\src/CAN.h:1: error: stray '\273' in program
C:\Users\mcneightne\Documents\Arduino\libraries\CAN_Library\src/CAN.h:1: error: stray '\277' in program

(with \357, \273, \277 being the octal representations of 0xEF, 0xBB, 0xBF)

I'm not sure if the IDE can do anything about passing the characters on to the compiler, but it should at least be able to handle the characters in the library.properties file.

-Neil

Metadata

Metadata

Assignees

Labels

Type: WontfixArduino has decided that it will not resolve the reported issue or implement the requested feature

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions