Why
# encoding: utf-8
out=File.open(\"z\\\\test.txt\", \"a\")
out.puts \"ç\"
out.close
out=File.open(\"z\\\\test.txt\", \"r\")
puts out.read+\"ś\"
Your script works fine for me on my box.
Is the error coming from your terminal application or from Ruby?
My terminal app is set to use utf-8.
You can probably avoid this problem by explicitly supplying an encoding when opening your files. See http://www.ruby-doc.org/core/classes/File.html#M000069 and follow the links to IO::new.