[Mono-bugs] [Bug 77074][Wis] New - ModMonoRequest default encoding

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Dec 22 17:18:50 EST 2005


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 colin at univ-metz.fr.

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

--- shadow/77074	2005-12-22 17:18:50.000000000 -0500
+++ shadow/77074.tmp.20710	2005-12-22 17:18:50.000000000 -0500
@@ -0,0 +1,47 @@
+Bug#: 77074
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Sys.Web
+AssignedTo: gonzalo at ximian.com                            
+ReportedBy: colin at univ-metz.fr               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: ModMonoRequest default encoding
+
+I had a strange encoding behavior with some url that contain non ascii
+characters.
+Searching why, i finally find a FIXME in the ModMonoRequest about encoding.
+
+So this is a try to fix it :) :
+Url are defined by RFC2396 which is now obsolete and replace by the RFC3986.
+for each data the transformation for non ascii character is defined like this :
+Non-ASCII characters must first be encoded according to UTF-8 [STD63], and
+then each octet of the corresponding UTF-8 sequence must be percent-encoded
+to be represented as URI characters.
+So in setting encoding to UTF8 you ensure to read both ASCII and
+transformed data.
+
+Index: ModMonoRequest.cs
+===================================================================
+--- ModMonoRequest.cs   (revision 54170)
++++ ModMonoRequest.cs   (working copy)
+@@ -156,8 +156,7 @@
+                                               total += chunk;
+                               } while ((chunk > 0 && total < size));
+
+-                               //FIXME: encoding!
+-                               s = Encoding.Default.GetString (buf);
++                               s = Encoding.UTF8.GetString (buf);
+                       } else {
+                               s = "";
+                       }
+
+Cyrille.


More information about the mono-bugs mailing list