Dear Joao,
you can update to Ruby 1.9, put the line
coding: utf-8
at the beginning of a non-ASCII script.
On Ubuntu 9.04 and ruby 1.9.1p243 (2009-07-16 revision 24175)
[i686-linux],
I get
zazolc gesla jazn
from your code.
Otherwise, there will be unrecognised multibyte letters in the Polish
input :
http://redmine.ruby-lang.org/issues/show/1238
Best regards,
Axel