Tag Archives: error: stray “\xxx” in program

Error: stray ‘- 239’in program solution

The SDK provided by the solution provider compiles and runs normally using GCC on the X86 platform.
However, when using miPSEL -Linux-GCC cross-compilation, the error is reported from the first line of the code, as shown in the figure below:
Error: stray ‘239 \’ in the program
Error: stray ‘387 \’ in the program

The reason:
Placing boms in UTF-8 files is largely Microsoft’s custom (by the way, it’s also Microsoft’s custom to call a SMALL sequence UTF-16 with A BOM “Unicode” without specifying it). BOM (Byte Order Mark) is prepared for UTF-16 and UTF-32 and is used to mark byte order. Microsoft USES BOM in UTF-8 because it makes a clear distinction between encoding like UTF-8 and ASCII, but such files can cause problems in operating systems other than Windows.
No BOM is required in UTF-8, although the Unicode standard allows the use of Boms in UTF-8. So UTF-8 without BOM is the standard form.
 
Solutions:
Use VI to open the code and set the NoBomb item.
: set nobomb
Save and exit.
 
Or, add Settings to the system’s VIM configuration file and reopen ViM:
vim ~/.vimrc