Rails 3 invalid multibyte char (US-ASCII)

*爱你&永不变心* 提交于 2019-11-27 11:07:48
Johanisma

Instead of adding # coding: UTF-8 try to add # encoding: UTF-8 on the first line of the file.

It worked for me. I found the information here : http://groups.google.com/group/sinatrarb/browse_thread/thread/f92529bf0cf62015

Just add the following line as the first line in the file:

# -*- coding: utf-8 -*-

and it will work.

Add a magic comment in the script where you use non-ascii chars? It should go on top of the script.

# encoding: utf-8

It worked for me like charm.

Or if you want to make the project wide, you have an option of magic-encoding gem

Kannan Natarajan

I changed the line:

gem 'pdf-writer', :git => 'git://github.com/metaskills/pdf-writer.git'

and that works for me.

Taken from http://devsolvd.com/questions/rails-3-invalid-multibyte-char-us-ascii

gem 'pdf-writer', :git => 'git://github.com/metaskills/pdf-writer.git'

This was useful for me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!