I’m having a problem with output gleaned from searching ISO-8859-9 web
I thought I had rectified this by opening the pages “r:ISO…”, and by
using .force_encoding and .encode! with the lines. This seems to work,
as according to logger.info output, execution makes it all the way
through the controller AND the view code…meaning I would have thought
there is nothing left for me to do.
After the controller code has run I get:
Then the view code runs and I get:
Completed in 1179ms (View: 11, DB: 1) | 200 OK
which seems strange, since
already happened. I had not noticed this before; what is the difference
between these two, and what is the significance of “Processing
ApplicationController#search” AFTER the view is already complete?
Anyway, that’s when I get
ArgumentError (invalid byte sequence in UTF-8):
run' /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:inblock in
So I have tried setting both internal and external encodings:
Encoding.default_external = @dir.encoding
Encoding.default_internal = @dir.encoding
In the hopes that this would mean everything – parsing, IO, etc. will
be done in ISO-8859-1, but obviously this is not the case. I presume I
cannot set the encoding for the scripts that aren’t mine, ie, the
webrick scripts that are throwing this error.
What can I do? AFAICT, all my code has executed without error, every
line dealt with is output via the logger, in the controller AND in the
view, A-ok, and then this happens? Why can I not just set everything
to one encoding for a duration? Is it webrick? I also tried using
Encoding::Converter on everything read in, to no avail…Help!