Hi I have a problem with charsets, please take a look at this test page: http://www.denlillemusikskole.dk/minside.html It shows 6 special letters ( danish letters ). First they are displayed, by directly typing them inside the html file. Secondly they are displayed thru an Ajax.updater like this: window.onload = function () { new Ajax.Updater (''mydivtagid'', myurl , {asynchronous:false}); } I am not very good in the charset stuff, but my guess is that the code coming via Ajax is treated as utf-8, when it''s really not. What can I do? regards, Kristian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey there, Kristian Nørgaard a écrit :> I am not very good in the charset stuff, but my guess is that the code > coming via Ajax is treated as utf-8, when it''s really not. > What can I do?Try customizing the charset part of your response''s Content-Type header so it matches the actual charset for your response text. It currently just states "text/html" so if you''re indeed using PHP on the server side (as your URL suggests), you''d go something like this before actually outputting the response: header(''Content-Type: text/html; charset=iso-8859-1''); (Assuming you''re using Latin1 throughout, which is too bad, btw. UTF-8 is unavoidable, so the sooner you board the train, the less pain you''ll feel later.) -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Your content-type: meta http-equiv="Content-Type" content="text/html; charset=latin1" /> You''re right that the javascript treats characters as UTF - but your page is initially rendered by the browser as latin1; which generally has a very limited character set. I would change the meta tag to charset=utf-8 to lend some consistency with the characters being displayed and go from there. On 5/22/07, Kristian Nørgaard <kristiannoergaard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi > > I have a problem with charsets, please take a look at this test page: > > http://www.denlillemusikskole.dk/minside.html > > It shows 6 special letters ( danish letters ). > First they are displayed, by directly typing them inside the html file. > Secondly they are displayed thru an Ajax.updater like this: > > window.onload = function () { > new Ajax.Updater (''mydivtagid'', myurl , {asynchronous:false}); > } > > I am not very good in the charset stuff, but my guess is that the code > coming via Ajax is treated as utf-8, when it''s really not. > What can I do? > > regards, > Kristian > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hi you''d go something like this before actually> outputting the response: > > header(''Content-Type: text/html; charset=iso-8859-1'');that was a fast response. and it works. Thanks. (Assuming you''re using Latin1 throughout, which is too bad, btw. UTF-8> is unavoidable, so the sooner you board the train, the less pain you''ll > feel later.)Yeah, I know. My Ubuntu already forces me to go there, but my web hotel still ... hmmm ... / Kristian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---