[Mono-bugs] [Bug 61181][Nor] New - HttpUtility.UrlDecode from bytes does not work

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 5 Jul 2004 17:13:30 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by dge@softec.st.

http://bugzilla.ximian.com/show_bug.cgi?id=61181

--- shadow/61181	2004-07-05 17:13:30.000000000 -0400
+++ shadow/61181.tmp.830	2004-07-05 17:13:30.000000000 -0400
@@ -0,0 +1,76 @@
+Bug#: 61181
+Product: Mono: Class Libraries
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Web
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: dge@softec.st               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: HttpUtility.UrlDecode from bytes does not work
+
+HttpUtility.UrlDecode(byte[],Encoding) does not properly decode. All
+encoded chars (%xx) are decoded as '\0'. I attach a testcase that works
+under MS.NET and not under mono 1.0. I have look at the implementation, but
+I was unable to figure out quickly what is wrong.
+
+Actual result (Mono):
+Original url:
+http://www.softec.st/pouet?Pi (?) and Sigma (?)
+
+UrlEncoded to bytes in UTF8:
+[104][116][116][112][37][51][65][37][50][70][37][50][70][119][119][119][46][115]
+[111][102][116][101][99][46][115][116][37][50][70][112][111][117][101][116][37][
+51][70][80][105][43][37][50][56][37][67][69][37][65][48][37][50][57][43][97][110
+][100][43][83][105][103][109][97][43][37][50][56][37][67][69][37][65][51][37][50
+][57]
+UTF8Decode only of these bytes:
+http%3A%2F%2Fwww.softec.st%2Fpouet%3FPi+%28%CE%A0%29+and+Sigma+%28%CE%A3%29
+
+Encoded to string to compare:
+http%3A%2F%2Fwww.softec.st%2Fpouet%3FPi+%28%CE%A0%29+and+Sigma+%28%CE%A3%29
+
+UrlDecoded bytes from UTF8:
+httpwww.softec.stpouetPiandSigma
+
+Same but shown as chars:
+[104][116][116][112][0][0][0][119][119][119][46][115][111][102][116][101][99][46
+][115][116][0][112][111][117][101][116][0][80][105][32][0][0][0][0][32][97][110]
+[100][32][83][105][103][109][97][32][0][0][0][0]
+
+UrlDecoded string:
+http://www.softec.st/pouet?Pi (?) and Sigma (?)
+
+
+Expected result (MS.Net):
+Original url:
+http://www.softec.st/pouet?Pi (p) and Sigma (S)
+
+UrlEncoded to bytes in UTF8:
+[104][116][116][112][37][51][97][37][50][102][37][50][102][119][119][119][46][11
+5][111][102][116][101][99][46][115][116][37][50][102][112][111][117][101][116][3
+7][51][102][80][105][43][40][37][99][101][37][97][48][41][43][97][110][100][43][
+83][105][103][109][97][43][40][37][99][101][37][97][51][41]
+UTF8Decode only of these bytes:
+http%3a%2f%2fwww.softec.st%2fpouet%3fPi+(%ce%a0)+and+Sigma+(%ce%a3)
+
+Encoded to string to compare:
+http%3a%2f%2fwww.softec.st%2fpouet%3fPi+(%ce%a0)+and+Sigma+(%ce%a3)
+
+UrlDecoded bytes from UTF8:
+http://www.softec.st/pouet?Pi (p) and Sigma (S)
+
+Same but shown as chars:
+[104][116][116][112][58][47][47][119][119][119][46][115][111][102][116][101][99]
+[46][115][116][47][112][111][117][101][116][63][80][105][32][40][928][41][32][97
+][110][100][32][83][105][103][109][97][32][40][931][41]
+
+UrlDecoded string:
+http://www.softec.st/pouet?Pi (p) and Sigma (S)