24
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

超簡単 VimでBOM削除

Last updated at Posted at 2016-05-26

ComposerでPSR-4を、、、って話はどうでもいいか。

とりあえず、namespaceをファイルの先頭に記述したときに、

Namespace declaration statement has to be the very first statement in the script

ってなったので、BOMが存在していると思いました。

コマンド以外でBOMを削除できないかと思い、たどり着いたのが以下の方法。

vim -b filename

Vim (Viでもいいけど) で当ファイルをバイナリモードで開き、BOMの16進数である、<feff> が先頭にあるので、それを消して保存するだけ。

簡単でしょ?

24
17
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
24
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?