shijialee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jan-23 20:57 UTC
form serialization for french word
Hi, I am using prototype''s Form.serialize to serialize data and post it to a url. sometimes the data may contain french word and it gets serialized as well. such as énfasis is escaped as %C3%A9nfasis and becomes énfasis when inserted to database. I am new to this realm of problem. how do i keep the word as is during such submit ? thanks, James. --~--~---------~--~----~------------~-------~--~----~ 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 James, Which encoding do you use otherwise in your web app? For Prototype and Scriptaculous it is highly advisable to use Unicode (UTF-8). Best regards Janko shijialee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Hi, > > I am using prototype''s Form.serialize to serialize data and post it to > a url. sometimes the data may contain french word and it gets > serialized as well. such as énfasis is escaped as %C3%A9nfasis and > becomes énfasis when inserted to database. I am new to this realm > of problem. how do i keep the word as is during such submit ? > > thanks, > > James. > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
shijialee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jan-23 21:28 UTC
Re: form serialization for french word
Janko Mivek wrote:> Hi James, > > Which encoding do you use otherwise in your web app? For Prototype and > Scriptaculous it is highly advisable to use Unicode (UTF-8). > > Best regards > JankoISO-8859-1. I would prefer to stay with it if possible as we use it everywhere else. James.> shijialee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > Hi, > > > > I am using prototype''s Form.serialize to serialize data and post it to > > a url. sometimes the data may contain french word and it gets > > serialized as well. such as énfasis is escaped as %C3%A9nfasis and > > becomes énfasis when inserted to database. I am new to this realm > > of problem. how do i keep the word as is during such submit ? > > > > thanks, > > > > James. > > > >--~--~---------~--~----~------------~-------~--~----~ 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, shijialee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org a écrit :> ISO-8859-1. I would prefer to stay with it if possible as we use it > everywhere else.Aside from the fact that "énfasis" is not a French word... :-) a) You can''t possibly hope to make intl apps (such as those dealing with more than one language) work in iso-8859-1. It is next to deprecated for 8859-15 already, and Unicode is just gaining ground by the minute b) Anything URL-transmitted is, by definition, UTF8-encoded. This is nominal behavior, not just Prototype''s or anything: it''s in the RFC for URI''s. Your server side must be able to properly decode UTF-8 URLs, as it is very likely to get some. Then it''s up to you to transcode this to whatever charset you''re using in the DB. Still, I *do* advise going UTF-8 throughout your stack ASAP. You''ll reap the benefits many times over. -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: 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 -~----------~----~----~----~------~----~------~--~---
Hello James, On 1/23/07, shijialee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <shijialee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> sometimes the data may contain french word and it gets > serialized as well. such as énfasis is escaped as %C3%A9nfasis and > becomes Ã(c)nfasis when inserted to database.Javascript strings are unicode, this is what your server script gets. You have to convert it to the charset you what to safe in the database in your server script. If you are just starting with your project, I suggest you convert everything you have so far to unicode (the server-side scripts, the generated HTMl, the DB content etc.). It is much easier that way in the long run. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
James, As Christophe already said, you should think about switching to Unicode now, because Ajax libraries usually demand UTF-8. I had similar problems with my Slovenian language and ISO-8859-2 and because of no luck with supporting it in Ajax, I decided to switch. This switch is once forever, that''s also a reason to consider! Janko shijialee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> > Janko Miv�ek wrote: >> Hi James, >> >> Which encoding do you use otherwise in your web app? For Prototype and >> Scriptaculous it is highly advisable to use Unicode (UTF-8). >> >> Best regards >> Janko > > ISO-8859-1. I would prefer to stay with it if possible as we use it > everywhere else. > > James. > >> shijialee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: >>> Hi, >>> >>> I am using prototype''s Form.serialize to serialize data and post it to >>> a url. sometimes the data may contain french word and it gets >>> serialized as well. such as �nfasis is escaped as %C3%A9nfasis and >>> becomes énfasis when inserted to database. I am new to this realm >>> of problem. how do i keep the word as is during such submit ? >>> >>> thanks, >>> >>> James. >>> >>> > > > > >-- Janko Miv�ek Svetovalec za informatiko EraNova d.o.o. Ljubljana, Slovenija www.eranova.si tel: 01 514 22 55 faks: 01 514 22 56 gsm: 031 674 565 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---