i have problems with umlauts (���) sent from an observer to my controller. i dont exactely know what my controller receives. using rails 1.1.6 on Win XP the text field is observed with this Observer: <%= observe_field ''suche'', :frequency => 2, :update => ''angebote'', :before => "Element.show(''snake_spinner'')", :complete => "Element.hide(''snake_spinner'')", :url => {:action => ''suche_angebote''}, :with => " ''query=''+ encodeURIComponent($(''suche'').value)" %> everything works fine. but if i enter umlauts into my field ''suche'', i get strange values passed to my controller. so, if i type in: � in my controller i''ll receive the following as param: "query"=>"\303\266" is this du the lack of utf-8 support in ruby/rails or what is happening here? or a js problem? saving and displaying umlauts in/from the database works without any problems. in application.rhtml: <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> headers from the observer POST: Host localhost:3000 User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2 Accept text/javascript, text/html, application/xml, text/xml, */* Accept-Language de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 300 Connection keep-alive X-Requested-With XMLHttpRequest X-Prototype-Version 1.5.0 Content-Type application/x-www-form-urlencoded; charset=UTF-8 Referer http://localhost:3000/dokument/list Content-Length 9 Cookie _session_id=14fde434003ce9fa32f57af64c8a6af2 Pragma no-cache Cache-Control no-cache --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---
no one? On 15 Mrz., 23:50, "dweinand" <mail...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> i have problems with umlauts (???) sent from an observer to my > controller. > i dont exactely know what my controller receives. using rails 1.1.6 on > Win XP > > the text field is observed with this Observer: > > <%= observe_field ''suche'', :frequency => 2, > :update => ''angebote'', > :before => "Element.show(''snake_spinner'')", > :complete => "Element.hide(''snake_spinner'')", > :url => {:action => ''suche_angebote''}, > :with => " ''query=''+ encodeURIComponent($(''suche'').value)" > %> > > everything works fine. but if i enter umlauts into my field ''suche'', i > get strange values passed to my controller. > so, if i type in: ? in my controller i''ll receive the following as > param: "query"=>"\303\266" > > is this du the lack of utf-8 support in ruby/rails or what is > happening here? or a js problem? > saving and displaying umlauts in/from the database works without any > problems. > > in application.rhtml: > <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> > > headers from the observer POST: > Host localhost:3000 > User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.2) > Gecko/20070219 Firefox/2.0.0.2 > Accept text/javascript, text/html, application/xml, text/xml, */* > Accept-Language de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 > Accept-Encoding gzip,deflate > Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 > Keep-Alive 300 > Connection keep-alive > X-Requested-With XMLHttpRequest > X-Prototype-Version 1.5.0 > Content-Type application/x-www-form-urlencoded; charset=UTF-8 > Referer http://localhost:3000/dokument/list > Content-Length 9 > Cookie _session_id=14fde434003ce9fa32f57af64c8a6af2 > Pragma no-cache > Cache-Control no-cache--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mar 16, 6:50 am, "dweinand" <mail...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> so, if i type in: ? in my controller i''ll receive the following as > param: "query"=>"\303\266">> puts "\303\266"ö Looks right to me (assuming that the character you pasted in your post (?) is the umlaut-o)... if you use String#inspect (which is likely what Rails'' log output uses) on a string, non-ascii chars will be shown as octal escapes. In this case, "\303\266" happens to be the utf-8 representation of codepoint 0xf6, "LATIN SMALL LETTER O WITH DIAERESIS".> saving and displaying umlauts in/from the database works without > any problems.So where''s the issue? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---