Hello, I''m new to the Prototype Framework. I''m trying to serialize a simple form with a few checkboxes. It seems like non-ascii characters, like Ö, are not encoded properly in some cases. Please take a look: http://troxy.net/serialize.htm Checking both boxes gives the following string: namn=%25C3%25B6rjan&namn=adam ..while it should look like this: namn=%C3%B6rjan&namn=adam Please tell me what I''m doing wrong. Thanks in advance. --~--~---------~--~----~------------~-------~--~----~ 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, You issue is due to an erroneous double-encoding of values when multiple fields share the same name, as is the case in your demo. Notice that if you only check the first checkbox, encoding is fine, but if you check both, encoding borks. This is due to line #649 in your prototype.js file. There is a patch on an unrelated issue that still fixes this: http://dev.rubyonrails.org/ticket/7421 It has not yet been committed though, but don''t post new defect tickets: they will be marked as duplicates, as was #7526 for instance. Until we issue a release with this patch in, I suggest you simply change line #649 to this: value = value != undefined ? value : ''''; ''HTH -- 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 -~----------~----~----~----~------~----~------~--~---
On Feb 22, 10:17 am, "troxy" <e...-P3BxZZkjs+heoWH0uzbU5w@public.gmane.org> wrote:> Hello, I''m new to the Prototype Framework. > I''m trying to serialize a simple form with a few checkboxes. > > It seems like non-ascii characters, like Ö, are not encoded properly > in some cases. > Please take a look:http://troxy.net/serialize.htm > > Checking both boxes gives the following string: > namn=%25C3%25B6rjan&namn=adam > > ..while it should look like this: > namn=%C3%B6rjan&namn=adam > > Please tell me what I''m doing wrong.Nothing - it seems to be a bug in Prototype. You might like to report it, it seems to happen when another button with the same name is checked. Your implementation of serialize doesn''t work in Safari, it might be another bug. -- Rob --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
This is actually a bug that I reported (http://dev.rubyonrails.org/ticket/7455) as well as several other people: http://dev.rubyonrails.org/ticket/7549 http://dev.rubyonrails.org/ticket/7526 This bug has been patched out (http://dev.rubyonrails.org/ticket/7421) but until you get that version with the patch, you can fix it yourself. I went into pretty thorough detail in my ticket (http://dev.rubyonrails.org/ticket/7455) on exactly what to do to correct this problem. Enjoy, -E On 2/22/07, RobG <rgqld-AFFH1GffN5hPR4JQBCEnsQ@public.gmane.org> wrote:> > > > On Feb 22, 10:17 am, "troxy" <e...-P3BxZZkjs+heoWH0uzbU5w@public.gmane.org> wrote: > > Hello, I''m new to the Prototype Framework. > > I''m trying to serialize a simple form with a few checkboxes. > > > > It seems like non-ascii characters, like Ö, are not encoded properly > > in some cases. > > Please take a look:http://troxy.net/serialize.htm > > > > Checking both boxes gives the following string: > > namn=%25C3%25B6rjan&namn=adam > > > > ..while it should look like this: > > namn=%C3%B6rjan&namn=adam > > > > Please tell me what I''m doing wrong. > > Nothing - it seems to be a bug in Prototype. You might like to report > it, it seems to happen when another button with the same name is > checked. > > Your implementation of serialize doesn''t work in Safari, it might be > another bug. > > > -- > Rob > > > > >-- Eric Ryan Harrison --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On a side note, thanks for providing a really nice little page showing off exactly what functionality you were having problems with. It''s a lot easier for people to help us troubleshoot your code with that kind of demonstration. Your demo page is an example of the best possible "Help Me Please" post. I congratulate you and hope that more people start posting demo pages exactly like yours whenever they are having problems. Thanks, -E On 2/22/07, Eric Harrison <blister-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> This is actually a bug that I reported > (http://dev.rubyonrails.org/ticket/7455) as well as several other > people: > > http://dev.rubyonrails.org/ticket/7549 > http://dev.rubyonrails.org/ticket/7526 > > This bug has been patched out (http://dev.rubyonrails.org/ticket/7421) > but until you get that version with the patch, you can fix it > yourself. I went into pretty thorough detail in my ticket > (http://dev.rubyonrails.org/ticket/7455) on exactly what to do to > correct this problem. > > Enjoy, > > -E > > On 2/22/07, RobG <rgqld-AFFH1GffN5hPR4JQBCEnsQ@public.gmane.org> wrote: > > > > > > > > On Feb 22, 10:17 am, "troxy" <e...-P3BxZZkjs+heoWH0uzbU5w@public.gmane.org> wrote: > > > Hello, I''m new to the Prototype Framework. > > > I''m trying to serialize a simple form with a few checkboxes. > > > > > > It seems like non-ascii characters, like Ö, are not encoded properly > > > in some cases. > > > Please take a look:http://troxy.net/serialize.htm > > > > > > Checking both boxes gives the following string: > > > namn=%25C3%25B6rjan&namn=adam > > > > > > ..while it should look like this: > > > namn=%C3%B6rjan&namn=adam > > > > > > Please tell me what I''m doing wrong. > > > > Nothing - it seems to be a bug in Prototype. You might like to report > > it, it seems to happen when another button with the same name is > > checked. > > > > Your implementation of serialize doesn''t work in Safari, it might be > > another bug. > > > > > > -- > > Rob > > > > > > > > > > > > > -- > Eric Ryan Harrison >-- Eric Ryan Harrison --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Feb 22, 8:53 pm, "Eric Harrison" <blis...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> This is actually a bug that I reportedAnd the bug with Safari? -- Rob --~--~---------~--~----~------------~-------~--~----~ 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 Rob, RobG a écrit :> And the bug with Safari?#7421 does indeed address the Safari bug as well: http://dev.rubyonrails.org/ticket/7421 -- 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 -~----------~----~----~----~------~----~------~--~---
Thanks for your help! I changed line #649 and it''s woking great now. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---