开发者

Ramaze Request Parameters in Unicode?

I've got a partial for rendering a form that is throwing an error using unicode; I've narrowed the error down to the line;

<input name='q' value='#{request.params['q']}' />

If I go to localhost/thepath?q=中文 it throws

Encoding::CompatibilityError at /thepath/
incompatible character encodings: ASCII-8开发者_运维技巧BIT and UTF-8

But

<input name='q' value='中文' />

Works fine, and all the unicode strings from values that aren't in the request work fine also.


One solution is to wash the input with #force_encoding, is there a more desirable method?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜