Maison  >  Questions et réponses  >  le corps du texte

ubuntu - Linux环境下如何将utf-8格式文件转变成无bom的utf-8格式文件?

基于Octopress搭建的博客,使用rake generate生成博客的时候会报如下的错误:

## Generating Site with Jekyll
identical source/stylesheets/screen.css 
Configuration from /srv/octopress/_config.yml
Building site: source -> public
Liquid Exception: incompatible encoding regexp match (ASCII-8BIT regexp with UTF-8 string) in page
/srv/octopress/plugins/category_list_tag.rb:9:in `gsub'
/srv/octopress/plugins/category_list_tag.rb:9:in `block in render'
/srv/octopress/plugins/category_list_tag.rb:6:in `each'
/srv/octopress/plugins/category_list_tag.rb:6:in `render'

参阅了网上的一些说明,是因为utf-8格式格式造成的,所以请问Linux环境下如何将utf-8格式文件转变成无bom的utf-8格式文件?

高洛峰高洛峰2713 Il y a quelques jours528

répondre à tous(1)je répondrai

  • 阿神

    阿神2017-04-17 11:23:17

    用 Vim 打开,

    :set nobomb
    :wq
    

    或者用 tail 命令:

    tail -c +4 old_file > new_file
    

    répondre
    0
  • Annulerrépondre