G
Gilles Gilles
Hi,
I have the following test case:
$ cat test.in
Der gro\xdfe BilderSauger
$ cat test.rb
File.open('test.in', 'r').each_line do |line|
puts line
test =3D "Der gro\xdfe BilderSauger"
puts test
The result is
Der gro\xdfe BilderSauger
Der gro?e BilderSauger
I have tried to put an encoding in the File.open() or line.encode()
without success. the '\' is recognized as a real '\', not as the
beginning of an hex escape sequence.
How can I get \xdf to be recognized as =C3=9F when reading from a file?
Thanks
--Gilles
-- =
Posted via http://www.ruby-forum.com/.=
I have the following test case:
$ cat test.in
Der gro\xdfe BilderSauger
$ cat test.rb
File.open('test.in', 'r').each_line do |line|
puts line
test =3D "Der gro\xdfe BilderSauger"
puts test
The result is
Der gro\xdfe BilderSauger
Der gro?e BilderSauger
I have tried to put an encoding in the File.open() or line.encode()
without success. the '\' is recognized as a real '\', not as the
beginning of an hex escape sequence.
How can I get \xdf to be recognized as =C3=9F when reading from a file?
Thanks
--Gilles
-- =
Posted via http://www.ruby-forum.com/.=