May 15

A byte-order mark (BOM) is the Unicode character at code point U+FEFF (“zero-width no-break space”) when that character is used to denote the endianness of a string of UCS/Unicode characters encoded in UTF-16 or UTF-32. It is conventionally used as a marker to indicate that text is encoded in UTF-8, UTF-16 or UTF-32.

ref: Wikipedia

ถ้าเปิดไฟล์ utf-8 ด้วย less จะพบว่ามี เป็นคำแรกในไฟล์ ซึ่งก็คือ Byte-order mark ซึ่งบางระบบอาจจะใช้งานไม่ได้ วิธีการเอาออกใน VI จะง่ายมาก หลังจากเปิดไฟล์ด้วย VI แล้วให้ใช้คำสั่ง
:set nobomb
แล้ว save ไฟล์ Byte-order mark ก็จะหายไปแล้วครับ

Tagged with:
preload preload preload