Re: [Simpleweb-Support] Problem decoding "+" characters (%2B)
Brought to you by:
niallg
From: Niall G. <gal...@ya...> - 2007-05-11 16:37:51
|
Hi,=0A=0AThis seems quite strange, I am sure I have tested this case many t= imes. I have also taken a look at the URIParser and it does not decode the = query, it simple spots the '?' and hands it off to the ParameterParser, whi= ch then decodes it. What exactly are you doing to create this scenario? Are= you simply performing a Request.getParameter(name) from a POST or GET?=0A= =0ANiall=0A=0A----- Original Message ----=0AFrom: "Wilson, Terry" <TXWilson= @ea.com>=0ATo: sim...@li...=0ASent: Friday, May = 11, 2007 1:18:30 AM=0ASubject: [Simpleweb-Support] Problem decoding "+" cha= racters (%2B)=0A=0A=0A=0A=0A =0A =0A=0A<!--=0A _filtered {font-family:Wingd= ings;panose-1:5 0 0 0 0 0 0 0 0 0;}=0A/* Style Definitions */=0A p.MsoNorma= l, li.MsoNormal, div.MsoNormal=0A=09{margin:0in;margin-bottom:.0001pt;font-= size:12.0pt;font-family:"Times New Roman";}=0Aa:link, span.MsoHyperlink=0A= =09{color:blue;text-decoration:underline;}=0Aa:visited, span.MsoHyperlinkFo= llowed=0A=09{color:purple;text-decoration:underline;}=0Aspan.EmailStyle17= =0A=09{font-family:Arial;color:windowtext;}=0A _filtered {margin:1.0in 1.25= in 1.0in 1.25in;}=0Adiv.Section1=0A=09{}=0A-->=0A=0A=0A=0A=0A=0A=0AHello,= =0A =0A=0A =0A =0A=0AI=92m having trouble sending the plus (+) character f= rom=0Aa client to a simple (3.1.3) server. I=92m hoping someone could point= out=0Awhat I=92m doing wrong J=0A =0A=0A =0A =0A=0AMy understanding is th= at the plus character needs to be=0Apercent encoded by the client to this: = %2B=0A =0A=0A =0A =0A=0ASo let=92s take this URL: http://server?val=3D%2B= =0A =0A=0A =0A =0A=0AWhen I send that to the server and print out the Para= meters=0Aobject I get from the request I see this:=0A =0A=0A =0A =0A=0Aval= =3D+=0A =0A=0A =0A =0A=0ALooks good so far, %2B has been decoded into a = =93+=94=0Acharacter. When I try to get the value with parameters.getParamet= er(=93val=94),=0Awhat I get back is a space (=93 =93). The javadoc for Para= meterParser mentions=0Athat the =93+=94 character is replaced with a space,= so I know this is=0Adone intentionally. Looks like the URL is first decode= d into the parameters=0Aobject and then this special rule is applied when r= etrieving individual=0Aparameter values.=0A =0A=0A =0A =0A=0ABut what if I= actually need to get a plus character through?=0AI thought that the =93+= =94 character is just shorthand for the space=0Aencoding of %20. Why is thi= s plus character rule being applied after the=0Adecoding has already taken = place?=0A =0A=0A =0A =0A=0AI might just be confused and this works exactly= as it should=0AJ If that is the case how is a client=0Asupposed to pass in= a plus character value? I=92ve tried various ways of=0Aencoding, but I hav= en=92t been able to get a plus sign to appear in the=0Astring I get from th= e getParameter(string) call.=0A =0A=0A =0A =0A=0A =0A =0A=0AThanks and an= y help appreciated,=0A =0A=0A =0A =0A=0ATerry=0A =0A=0A =0A =0A=0A =0A = =0A=0A=0A=0A=0A------------------------------------------------------------= -------------=0AThis SF.net email is sponsored by DB2 Express=0ADownload DB= 2 Express C - the FREE version of DB2 express and take=0Acontrol of your XM= L. No limits. Just data. Click to get it now.=0Ahttp://sourceforge.net/powe= rbar/db2/=0A_______________________________________________=0ASimpleweb-Sup= port mailing list=0AS...@li...=0Ahttps://lists= .sourceforge.net/lists/listinfo/simpleweb-support=0A=0A=0A=0A=0A=0A=0A=0A = =0A___________________________________________________________________= _________________Need a vacation? Get great deals=0Ato amazing places on Ya= hoo! Travel.=0Ahttp://travel.yahoo.com/ |