hello all, a small problem with ajax : when i use a view, whith non ascii char i have a corect rendering off the car. ex : <p>désertè</p> => render corectly in my browser. (désertè) when i do : <div="update"></div> <script type="text/javascript"> new Ajax.Updater(''update'', ''/troublefollow/show'', {asynchronous:true, evalScripts:true}); </script> with views/trouble/show.rhtml => <p>désertè</p> it render like d?sert? can someone help to issue this. I need that because i have a big page, wich need to render async . "Ce message et toutes les pièces jointes sont des informations strictement confidentielles et réservées au(x) destinataire(s). Ce courriel n''a pas de valeur contractuelle et son contenu ne constitue ni une acceptation, ni un engagement de la part de l''auteur et des sociétés du groupe Serveur et Artprice, sauf dans le cas où cela aurait été prévu avec le destinataire par un accord écrit. Le contenu de ce message et les pièces jointes ne peuvent constituer une preuve au sens de l''article 1316-1 du Code Civil. L.auteur et les sociétés du groupe Serveur et Artprice déclinent toute responsabilité au titre de ce courriel s''il a été altéré, déformé, falsifié ou indûment utilisé par des tiers ou encore s''il a causé tout dommage ou perte de toute nature. Si vous n''êtes pas le bon destinataire, merci de nous contacter et de ne pas le divulguer." "This message including any attachments are confidential and privileged material intended solely for the addressees. Its contents do not constitute a commitment by groupe Serveur sas and Artprice SA, except when provided for in a written agreement with the addressees. The contents of this message cannot constitute neither the proof nor the acceptance of any agreement as per article 1316-1 of the French civil code. Groupe Serveur sas and Artprice SA shall not be rendered liable in any manner whatsoever for the delay and/or loss in transit of this message, for corruption, alteration, falsification, misuse or fraudulent use (which may be made) of this message. If you receive this message in error, please delete it and immediately notify the sender. If the reader of this message is not the intended recipient, you are hereby notified that any unauthorized use, copying or dissemination is prohibited."
Christophe Vigny wrote:> hello all, > > a small problem with ajax : > > when i use a view, whith non ascii char i have a corect rendering off > the car. > ex : > <p>désertè</p> => render corectly in my browser. (désertè) > > when i do : > <div="update"></div> > <script type="text/javascript"> > new Ajax.Updater(''update'', ''/troublefollow/show'', {asynchronous:true, > evalScripts:true}); > </script> > > with views/trouble/show.rhtml => <p>désertè</p> > > it render like d?sert?Sounds like something this link could be useful for: http://www.kanthak.net/explorations/blog/rails/ajax_and_charsets.html Character sets are a right pain in the wotsits. -- Alex
See http://wiki.rubyonrails.org/rails/pages/HowToUseUnicodeStrings for a possible solution for this (especially, take a look at the after_filter function). Works for me with german umlauts etc. Thomas Am 26.10.2005 um 11:38 schrieb Christophe Vigny:> hello all, > > a small problem with ajax : > > when i use a view, whith non ascii char i have a corect rendering > off the car. > ex : > <p>désertè</p> => render corectly in my browser. (désertè) > > when i do : > <div="update"></div> > <script type="text/javascript"> > new Ajax.Updater(''update'', ''/troublefollow/show'', > {asynchronous:true, evalScripts:true}); > </script> > > with views/trouble/show.rhtml => <p>désertè</p> > > it render like d?sert? > > can someone help to issue this. > I need that because i have a big page, wich need to render async . > > "Ce message et toutes les pièces jointes sont des informations > strictement confidentielles et réservées au(x) destinataire(s). Ce > courriel n''a pas de valeur contractuelle et son contenu ne > constitue ni > une acceptation, ni un engagement de la part de l''auteur et des > sociétés > du groupe Serveur et Artprice, sauf dans le cas où cela aurait été > prévu > avec le destinataire par un accord écrit. Le contenu de ce message et > les pièces jointes ne peuvent constituer une preuve au sens de > l''article > 1316-1 du Code Civil. L.auteur et les sociétés du groupe Serveur et > Artprice déclinent toute responsabilité au titre de ce courriel s''il a > été altéré, déformé, falsifié ou indûment utilisé par des tiers ou > encore s''il a causé tout dommage ou perte de toute nature. Si vous > n''êtes pas le bon destinataire, merci de nous contacter et de ne > pas le > divulguer." > > "This message including any attachments are confidential and > privileged > material intended solely for the addressees. Its contents do not > constitute a commitment by groupe Serveur sas and Artprice SA, except > when provided for in a written agreement with the addressees. The > contents of this message cannot constitute neither the proof nor the > acceptance of any agreement as per article 1316-1 of the French > civil code. > Groupe Serveur sas and Artprice SA shall not be rendered liable in any > manner whatsoever for the delay and/or loss in transit of this > message, > for corruption, alteration, falsification, misuse or fraudulent use > (which may be made) of this message. If you receive this message in > error, please delete it and immediately notify the sender. If the > reader > of this message is not the intended recipient, you are hereby notified > that any unauthorized use, copying or dissemination is prohibited." > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Just my 2$, true story: Latin 1 encoding was fine EXCEPT for ajax (I needed german chars), so I changed my encoding to utf-8 (I did exactly what is described on the wiki). My customer needed reports. So I started working with pdf-writer which DOES NOT support utf-8! argh, stuck? no, before I write my strings in the pdf file, I use the two methods unpack(''U*'').pack(''c*'') ... it seems to work OK so far (unpack(''U*'') converts utf-8 encoding to integer, pack(''c*'') repack theses in characters... ). Useful. However, if anyone has a better method, I would be glad to hear it. On 10/26/05, Christophe Vigny <cvigny-TzZIYC/1obNWk0Htik3J/w@public.gmane.org> wrote:> > thank''s for that good help ! > > > Alex Young wrote: > > Christophe Vigny wrote: > > hello all, > > a small problem with ajax : > > when i use a view, whith non ascii char i have a corect rendering off > the car. > ex : > <p>désertè</p> => render corectly in my browser. (désertè) > > when i do : > <div="update"></div> > <script type="text/javascript"> > new Ajax.Updater(''update'', ''/troublefollow/show'', {asynchronous:true, > evalScripts:true}); > </script> > > with views/trouble/show.rhtml => <p>désertè</p> > > it render like d?sert? > > Sounds like something this link could be useful for: > > http://www.kanthak.net/explorations/blog/rails/ajax_and_charsets.html > > Character sets are a right pain in the wotsits. > > > > "Ce message et toutes les pièces jointes sont des informations strictement > confidentielles et réservées au(x) destinataire(s). Ce courriel n''a pas de > valeur contractuelle et son contenu ne constitue ni une acceptation, ni un > engagement de la part de l''auteur et des sociétés du groupe Serveur et > Artprice, sauf dans le cas où cela aurait été prévu avec le destinataire par > un accord écrit. Le contenu de ce message et les pièces jointes ne peuvent > constituer une preuve au sens de l''article 1316-1 du Code Civil. L.auteuret les sociétés du groupe Serveur et Artprice déclinent toute responsabilité > au titre de ce courriel s''il a été altéré, déformé, falsifié ou indûment > utilisé par des tiers ou encore s''il a causé tout dommage ou perte de toute > nature. Si vous n''êtes pas le bon destinataire, merci de nous contacter et > de ne pas le divulguer." > > "This message including any attachments are confidential and privileged > material intended solely for the addressees. Its contents do not constitute > a commitment by groupe Serveur sas and Artprice SA, except when provided for > in a written agreement with the addressees. The contents of this message > cannot constitute neither the proof nor the acceptance of any agreement as > per article 1316-1 of the French civil code. Groupe Serveur sas and Artprice > SA shall not be rendered liable in any manner whatsoever for the delay > and/or loss in transit of this message, for corruption, alteration, > falsification, misuse or fraudulent use (which may be made) of this message. > If you receive this message in error, please delete it and immediately > notify the sender. If the reader of this message is not the intended > recipient, you are hereby notified that any unauthorized use, copying or > dissemination is prohibited." > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails