Note that there are some explanatory texts on larger screens.

plurals
  1. POResolving URI character encoding issues in Rails
    primarykey
    data
    text
    <p>I'm working with a Ruby on Rails application that makes a client side API call to a 3rd party service. It then takes strings from the 3rd party API and generates URIs with them.</p> <p>Unfortunately, Rails fails to parse some of the URIs due to encoding errors. I have tried running the strings through encodeURIComponent, but this does not resolve the issue.</p> <p>Here is the error I get:</p> <pre><code>Processing ApplicationController#index (for 67.101.113.66 at 2010-08-12 23:24:55) [GET] Parameters: {"name"=&gt;"Camilo Andr\xE9s \xD1ustes", "recipient_id"=&gt;"279"} ArgumentError (invalid byte sequence in US-ASCII): &lt;internal:prelude&gt;:8:in `synchronize' /home/heroku_rack/lib/static_assets.rb:9:in `call' /home/heroku_rack/lib/last_access.rb:25:in `call' /home/heroku_rack/lib/date_header.rb:14:in `call' thin (1.2.6) lib/thin/connection.rb:76:in `block in pre_process' thin (1.2.6) lib/thin/connection.rb:74:in `catch' thin (1.2.6) lib/thin/connection.rb:74:in `pre_process' thin (1.2.6) lib/thin/connection.rb:57:in `process' thin (1.2.6) lib/thin/connection.rb:42:in `receive_data' eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine' eventmachine (0.12.10) lib/eventmachine.rb:256:in `run' thin (1.2.6) lib/thin/backends/base.rb:57:in `start' thin (1.2.6) lib/thin/server.rb:156:in `start' thin (1.2.6) lib/thin/controllers/controller.rb:80:in `start' thin (1.2.6) lib/thin/runner.rb:177:in `run_command' thin (1.2.6) lib/thin/runner.rb:143:in `run!' thin (1.2.6) bin/thin:6:in `&lt;top (required)&gt;' /usr/ruby1.9.1/bin/thin:19:in `load' /usr/ruby1.9.1/bin/thin:19:in `&lt;main&gt;' </code></pre> <p>How do I properly handle these strings as input for my application?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload