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+%E9l%E8ve.&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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Apr 2, 4:23 pm, Christophe Decaux <christophe.dec...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 in advance, > > Christophe-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Christophe Decaux
2010-Apr-08 07:19 UTC
Re: Re: Issue with character encoding in http request
Thanks a lot. I had some difficulties to find info about iconv, but it works. Christophe Le 2 avr. 2010 à 19:07, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> a écrit :> > > On Apr 2, 4:23 pm, Christophe Decaux <christophe.dec...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > 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 in advance, >> >> Christophe > > -- > You received this message because you are subscribed to the Google > Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails- > talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com > . > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en > . >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.