From: "Mark J. Reed" Date: 2003-07-21T06:17:10+09:00 Subject: Re: Parsing POST and GET variables simultaneously? Somehow, despite the explicit instructions in my subject line, this has turned into YAEPT. The sheer power of that topic is amazing; it's like a black hole sucking in all threads which get too close to its event horizon. Obviously my English phoneme thread started out way too close; I was orbiting the darn thing. Anyway . . On Sat, Jul 19, 2003 at 11:05:59PM -0400, John Cowan wrote: > AFAIK, all Americans pronounce "Mary" as /meiri/; > they pronounce "merry" and "marry" as /meiri/ also. For me they are > /mEri/ and /m&ri/ respectively. Most definitely not. For me, my wife, our tenant, and most of my friends and coworkers, all three of them are [mE`r\i], with the same vowel (apart from the rhoticization) as "met", "bled", etc; as distinguished from the vowel of "mate", "blade", etc. Other a+r words have the same "short-e" vowel: "bare" (which doesn't rhyme with the trade name Bayer, which has /ei/), "care", "dare", "fair", "fare", "hair", "hare", etc. > As for "yeah", I've always thought it was a peculiar and perverse > spelling for the word /jV/. Again, not hereabouts. "Yeah" is pronounced /j{/; it seems to be a exception to the rule that disallows lax open monosyllables in English. > If I speak it in extreme slow motion, > it comes out /je:::::V/, but that's bizarre. Here it's more like /j{::::ijV/. -Mark From markjreed@mail.com Sun Jul 20 17:14:14 2003 From: "Mark J. Reed" To: David Heinemeier Hansson Subject: Re: Parsing POST and GET variables simultaneously? References: <20030720172047.GA28762@mulan.thereeds.org> <2878AB4E-BADA-11D7-9A77-000A959C001E@loudthinking.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2878AB4E-BADA-11D7-9A77-000A959C001E@loudthinking.com> X-Julian-Day: JD 2452841.38079 X-Roman-Date: ante diem XIII =?utf-8?Q?Kalend=C4=81s_Aug?= =?utf-8?B?dXN0xIFz?= A.U.C. MMDCCLVI X-Mutt-References: <2878AB4E-BADA-11D7-9A77-000A959C001E@loudthinking.com> X-Mutt-Fcc: =sent Status: RO Content-Length: 943 Lines: 37 On Mon, Jul 21, 2003 at 02:47:37AM +0900, David Heinemeier Hansson wrote: > class CGI > def query_params > params = {} > > ENV['QUERY_STRING'].split("&").each { |p| > k, v = p.split("=") > params[CGI.unescape(k)] = CGI.unescape(v) > } > > params > end > end > > ..that does the trick. God, I love Ruby. May I never stray back into > PHP-land again :) May your wish come true. :) And that solution will indeed work most of the time. However, to be perfectly compliant with modern protocols, you need to split on either '&' or ';'. And it'd be better to use the query_string method than to directly access the environment variable: class CGI def query_params params = {} query_string.split(/[&;]/).each { |p| k, v = p.split('=') params[CGI.unescape(k)] = CGI.unescape(v) } params end end -Mark