Sinatra / Rack fails with non-ascii characters in url

Posted by Piotr Zolnierek on Stack Overflow See other posts from Stack Overflow or by Piotr Zolnierek
Published on 2009-12-22T18:17:34Z Indexed on 2010/03/20 15:11 UTC
Read the original article Hit count: 376

Filed under:
|
|

I am getting Encoding::UndefinedConversionError at /find/Wroclaw "\xC5" from ASCII-8BIT to UTF-8

For some mysterious reason sinatra is passing the string as ASCII instead of UTF-8 as it should.

I have found some kind of ugly workaround... I don't know why Rack assumes the encoding is ASCII-8BIT ... anyway, a way is to use string.force_encoding("UTF-8")... but doing this for all params is tedious

© Stack Overflow or respective owner

Related posts about ruby

Related posts about sinatra