> http://github.com/sinatra/sinatra/issues#issue/38
I think the whole point of Ruby encodings is that you specify them in
the file where the encoding is used; if I wrote in something else than
UTF-8, adding ‘# encoding: UTF-8’ to tilt.rb wouldn’t help me at all.
You should add the comment to the file which contains
the non-US-ASCII string or run Ruby with the -KU switch.
— Piotr Szotkowski
--
phrases that shouldn’t exist on the web:
read more after the jump
skip this ad
remember me on this computer
page 1 of #
[Faruk Ateş]
> I had problems with encoding on ruby 1.9 with sinatra, but solved
> it by specifying default_internal and default_external encoding
> Encoding.default_external = 'utf-8'
> Encoding.default_internal = 'utf-8'
Note that the above throws Ruby warnings:
chastell@devielle:~$ ruby -wve "Encoding.default_external = 'UTF-8'; Encoding.default_internal = 'UTF-8'"
ruby 1.9.1p378 (2010-01-10 revision 26273) [x86_64-linux]
-e:1: warning: setting Encoding.default_external
-e:1: warning: setting Encoding.default_internal
chastell@devielle:~$
— Piotr Szotkowski
--
Amateur fighter pilot ignores orders, listens to
the voices in his head and slaughters thousands.
[Star Wars ending explained]