title: invalid byte sequence in UTF-8 with Rails flash messages
body: <p>we use Rails 3 and Spree Commerce for our online shop and we have a payment provider, that returns errors in a redirect URL if some occur. When an error occurs, we present that string with flash messages to the user.</p>
  
  <p>Yesterday, something didn't work, and the payment provider returned this string in the redirect URL, which should be presented to the user inside a flash message:</p>
  
  <pre><code>errormsg=Bitte+versuchen+Sie+es+sp%E4ter+nochmals.
  </code></pre>
  
  <p>I debugged a little bit, and the string looks like this when decoded (e.g. is written to flash[:error]):</p>
  
  <pre><code>Bitte versuchen Sie es sp\xE4ter nochmals.
  </code></pre>
  
  <p>And after that, an error is raised, when rails tries to render the flash message:</p>
  
  <pre><code>invalid byte sequence in UTF-8
  </code></pre>
  
  <p>Can someone tell me, how to fix this? The error should contain a german <code>ä</code> and not <code>\xE4</code>. I tried setting <code># encoding: utf-8</code> to the beginning of the controller and the view, but this doesn't help.</p>