문제

when I run a command like:

cat file1.js file2.js file3.js > all.js

On mac osx the all.js has strange characters prepended at the boundaries of the files.

The strange characters are the following values in hex editor:

EF BB BF

Anyone know what OS setting I need to change?

도움이 되었습니까?

해결책

EF BB BF is the UTF-8 representation of U+FEFF - the UTF BOM (Byte Order Mark). It is placed at the beginning of the file by some editors and its purpose is to identify whether the originator system was little endian or big endian. This is redundant as UTF-8 uses fixed byte ordering and therefore the BOM only signals the beginning of UTF-8-endcoded text. Check your editor's settings and tell it not to write BOMs.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top