Ruby: how to add “# encoding: UTF-8” automatically?

前端 未结 6 1023
时光说笑
时光说笑 2020-12-05 00:21

Is there any gem which adds # encoding: UTF-8 to each Ruby file automatically?

Or is there any other way to prevent from the invalid multibyte cha

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 00:53

    Try magic_encoding gem, it can insert uft-8 magic comment to all ruby files in your app.

    [EDIT] Having switched to SublimeText now I use auto-encoding-for-ruby plugin.

提交回复
热议问题