page 575, the downloaded code of ref_io/encoding_transcode_problem.rb
and ref_io/encoding_transcode_problem_2.rb
has a chdir
which does not appear in the book and causes an error (as usual, the current working directory is code
),
% ruby -w ref_io/encoding_transcode_problem.rb
ref_io/encoding_transcode_problem.rb:9:in `chdir': No such file or directory @ dir_s_chdir - code/encoding (Errno::ENOENT)
from ref_io/encoding_transcode_problem.rb:9:in `<main>'
After changing Dir.chdir("code/encoding")
to Dir.chdir("encoding")
:
% ruby -w ref_io/encoding_transcode_problem.rb
UTF-8
UTF-8
ol?
+++++ Also ref_io/encoding_transcode.rb
and ref_io/encoding_binary.rb
on next page.