This project is archived and is in readonly mode.
Response should be encoded in charset
-
donncha
Err, allowing for no charset... whoops! :)
-
Jeremy Kemper
- State changed from new to invalid
Your template needs to have the correct encoding. Set Encoding.default_external = "iso-8859-1".
-
donncha
Sorry, doesn't work.
If I add
to the controller's method I still get the "invalid sequence in UTF-8" error. Debugging into ActionController#Base.render shows that External.default_external is in fact ISO-8859-1, but the response.body string still thinks it's UTF-8 (although it contains ISO-8859-1 characters), so it fails at the blank? call.Encoding.default_external = 'iso-8859-1'[188, 197] in /Users/donch/Development/Exact/Steam/3583/vendor/rails/actionpack/lib/action_controller/response.rb 188 def handle_conditional_get! 189 if etag? || last_modified? 190 set_conditional_cache_control! 191 elsif nonempty_ok_response? 192 debugger => 193 self.etag = body 194 195 if request && request.etag_matches?(etag) 196 self.status = '304 Not Modified' 197 self.body = '' /Users/donch/Development/Exact/Steam/3583/vendor/rails/actionpack/lib/action_controller/response.rb:193 self.etag = body (rdb:1) Encoding.default_external #<Encoding:ISO-8859-1> (rdb:1) body.encoding #<Encoding:UTF-8> (rdb:1)Furthermore, my encoding is now also set to ISO-8859-1 for all future requests, which is not what I want. I want to be able to output ISO-8859-1 for a single particular request, but have the rest of my app remain in UTF-8.
If I set the charset for the response to ISO-8859-1, why is the response encoding in UTF-8?
