質問

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