What's the difference between UTF-8 and UTF-8 without BOM?

前端 未结 21 1395
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-21 05:45

What\'s different between UTF-8 and UTF-8 without a BOM? Which is better?

21条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-11-21 06:27

    One practical difference is that if you write a shell script for Mac OS X and save it as plain UTF-8, you will get the response:

    #!/bin/bash: No such file or directory
    

    in response to the shebang line specifying which shell you wish to use:

    #!/bin/bash
    

    If you save as UTF-8, no BOM (say in BBEdit) all will be well.

提交回复
热议问题