Issue with character encoding in http request

Hi there,

I have an issue with character encoding on http request that I need to
handle in my rails apps.

Here’s an example of my log :

Processing MessagesController#incoming (for 217.117.146.164 at
2010-04-02 16:08:27) [GET]
Parameters: {“action”=>“incoming”, “z”=>“Je suis un bon ?l?ve.”,
“alias”=>“33699425463”, “controller”=>“messages”}
… some db processing…
Rendering messages/incoming
Completed in 39ms (View: 2, DB: 27) | 200 OK
[http://server.mydomain.com/in/?z=Je+suis+un+bon+�l�ve.&alias=33699425463]

As you can guess I expect the system to receive the z value decoded as
“Je suis un bon élève.” and not “Je suis un bon ?l?ve.”

Anyone as faced this issue already ?

By the way, I cannot ask the request sender to change his encoding
method…
On the other hand, I’ve setup everything in my app to use utf-8 which
works fine…

Thanks in advance,

Christophe

On Apr 2, 4:23 pm, Christophe D. [email protected]
wrote:

By the way, I cannot ask the request sender to change his encoding method…
On the other hand, I’ve setup everything in my app to use utf-8 which works fine…

Well if you cannot change the sender then you don’t have a choice -
you’ll have to convert the input (probably an iso latin varient) into
utf8. The iconv library can handle a large number of encodings.

Fred

Thanks a lot.
I had some difficulties to find info about iconv, but it works.
Christophe

Le 2 avr. 2010 à 19:07, Frederick C. [email protected]
a écrit :

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs