Joshua Muheim
2006-Sep-19 14:28 UTC
Very strange: Umlauts (äöü) aren''t displayed correctly in
Hi all Take a look at the following video, please... I just'' can''t help me anymore... http://josh.ch/files/temp/rails_problem.mov I''m sorry for the bad quality, it''s just a demo of Snapz Pro X 2... ;-) But I hope you''ll see enought... Thanks for any help. Josh -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Beate Paland
2006-Sep-19 15:17 UTC
Re: Very strange: Umlauts (äöü) aren''t displayed correctly in
Hi, I think the problem is in Firefox, that the UTF-8 declaration is missing in the header. Try it :) Beate --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Yuri Leikind
2006-Sep-19 15:26 UTC
Re: Very strange: Umlauts (äöü) aren''t displayed correctly in
Hi, That''s a nice movie, but really, have you checked what headers are sent to the browser? Can you something similar to wget --save-headers http://youhost/path/to/your/app and see if there''s charset there. If it''s not there try adding the following to ApplicationController: after_filter :set_charset def set_charset content_type = @headers["Content-Type"] || ''text/html'' if /^text\//.match(content_type) @headers["Content-Type"] = "#{content_type}; charset=utf-8" end end If anyone has a nicer solution please let me know. Best regards, Yuri Joshua Muheim wrote:> Hi all > > Take a look at the following video, please... I just'' can''t help me > anymore... > > http://josh.ch/files/temp/rails_problem.mov > > I''m sorry for the bad quality, it''s just a demo of Snapz Pro X 2... ;-) > But I hope you''ll see enought... > > Thanks for any help. > Josh > > -- > Posted via http://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> wget --save-headers http://youhost/path/to/your/appThere really was no charset...> If it''s not there try adding the following to ApplicationController: > > after_filter :set_charset > > def set_charset > content_type = @headers["Content-Type"] || ''text/html'' > if /^text\//.match(content_type) > @headers["Content-Type"] = "#{content_type}; charset=utf-8" > end > endNow the headers do have a charset: Host: localhost:3007 User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en-gb;q=0.7,de-ch;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 Cookie: _session_id=68e4e78cad839de4bea6b26894cae57c Cache-Control: max-age=0 But it''s still full of "???" for "äöü". Absolutely frustrating... :-( -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
and (funny stuff): safari now also only shows questionmarks... The problem must be somewhere else... *banging-my-head-on-the-keyboard* -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You are using RJS? Check youre headers for this. I am having the same problem. But for me it works in Firefox but not in Safari. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Peter wrote:> You are using RJS?Why do you think that?> Check youre headers for this. > I am having the same problem. > > But for me it works in Firefox but not in Safari.Very, very strange and extremely frustrating... My apps all act a little different. Either they display the stuff correctly in the Rails app but e.g. not in phpMyAdmin/CocoaMySQL or vice versa... :-( -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Pete Yandell
2006-Sep-20 00:48 UTC
Re: Very strange: Umlauts (äöü) aren''t displayed correctly in
Joshua, There''s a lot you need to do to make Rails handle UTF8 correctly. See http://wiki.rubyonrails.com/rails/pages/HowToUseUnicodeStrings In short: 1. You need to make sure your database is set to use UTF8, which it probably won''t be if you''ve created it in CocoaMySQL. Use ALTER DATABASE xyz CHARSET=''utf8'' 2. You need to tell Rails to speak to the database in UTF8 by adding "encoding: utf8" to each database in database.yml 3. You need to tell Ruby that you want to use UTF8 by putting the following in your environment.rb: require ''jcode'' $KCODE=''u'' 4. You need to make Rails pass back the correct content type header by putting the following in application.rb: after_filter :set_charset def set_charset content_type = @headers["Content-Type"] || ''text/html'' if /^text\//.match(content_type) @headers["Content-Type"] = "#{content_type}; charset=utf-8" end end Cheers, Pete Yandell On 20/09/2006, at 12:28 AM, Joshua Muheim wrote:> > Hi all > > Take a look at the following video, please... I just'' can''t help me > anymore... > > http://josh.ch/files/temp/rails_problem.mov > > I''m sorry for the bad quality, it''s just a demo of Snapz Pro X > 2... ;-) > But I hope you''ll see enought... > > Thanks for any help. > Josh > > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks a lot for your help, I''m gonna try that. But why isn''t there just a switch in Rails that allows me poor german (swiss german) user to use my beloved umlauts? What about convention over configuration? In this way Rails is still very unfriendly (also in things like the auto-generated form validation errors... try to use them in a german app!)... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Joshua Muheim wrote:> But why isn''t there just a switch in Rails that allows me poor german > (swiss german) user to use my beloved umlauts?The simple answer is that nobody has built it yet! There are now a couple of plugins floating around that provide much better unicode handling, and there''s discussion going on about including some of this in Rails 1.2. You can expect the situation to improve with time. Cheers, Pete Yandell --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---