【发布时间】:2014-09-29 01:41:33
【问题描述】:
我使用 RestClient 通过 GET 从 Web 服务中检索 json 字符串。 这工作正常,但只要字符串中有元音变音(ü)和其他字符(例如ß),我就会在我的视图中收到此错误
@output = RestClient.get 'https://myurl.com/api/v1/orders/53e0ae7f6630361c46060000', {:authorization => 'Token xxxxxx', :content_type => :json, :accept => :json}
<%= @output %>
=>
Encoding::CompatibilityError
incompatible character encodings: UTF-8 and ASCII-8BIT
知道如何解决这个问题吗?
【问题讨论】:
标签: ruby-on-rails json utf-8 character-encoding