Skip to content

Instantly share code, notes, and snippets.

@ddellacosta
Created May 16, 2011 07:22
Show Gist options
  • Save ddellacosta/974037 to your computer and use it in GitHub Desktop.
Save ddellacosta/974037 to your computer and use it in GitHub Desktop.
# UTF-8 value on page:
"Adélaïde de Hongrie"
# GET string:
Started GET "/registers/results?filter[title][]=Ad%E9la%EFde%20de%20Hongrie&search=&limit=4" for 127.0.0.1 at 2011-05-16 14:17:33 +0700
# What Rails gets/Rack produces (in Controller):
Parameters: {"filter"=>{"title"=>["Ad\xE9la\xEFde de Hongrie"]}, "search"=>"", "limit"=>"4"}
# Error I'm getting:
ArgumentError (invalid byte sequence in UTF-8):
# What would actually be a valid string with hex UTF code points the above UTF-8 value:
"Ad\xC3\xA9la\xC3\xAFde de Hongrie"
OR
"Ad\u{E9}la\u{EF}de de Hongrie"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment