List Info

Thread: form serialization for french word




form serialization for french word
user name
2007-01-23 14:57:53
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-spinoffsgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=
en
-~----------~----~----~----~------~----~------~--~---


Re: form serialization for french word
user name
2007-01-23 15:15:00
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

shijialeegmail.com 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-spinoffsgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=
en
-~----------~----~----~----~------~----~------~--~---


Re: form serialization for french word
user name
2007-01-23 15:28:08

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.

> shijialeegmail.com 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-spinoffsgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=
en
-~----------~----~----~----~------~----~------~--~---


Re: form serialization for french word
user name
2007-01-23 15:41:43
Hey there, shijialeegmail.com 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: tddtddsworld.com --~--~---------~--~----~------------~-------~--~----~ 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-spinoffsgooglegroups.com To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribegooglegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Re: form serialization for french word
user name
2007-01-23 15:44:22
Hello James, On 1/23/07, shijialeegmail.com gmail.com> 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-spinoffsgooglegroups.com To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribegooglegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Re: form serialization for french word
user name
2007-01-23 15:52:10
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 shijialeegmail.com 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. > >> shijialeegmail.com 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-spinoffsgooglegroups.com To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribegooglegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )