Author: gonzalo
Date: 2005-06-23 16:55:20 -0400 (Thu, 23 Jun 2005)
New Revision: 46452
Modified:
trunk/mcs/class/System.Web/System.Web/ChangeLog
trunk/mcs/class/System.Web/System.Web/HttpUtility.cs
Log:
2005-06-23 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* HttpUtility.cs: the lower limit for using &#xx; encoding is 160, not
128. Reset number back to 0 after use. Fixes bug #75365.
Modified: trunk/mcs/class/System.Web/System.Web/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web/ChangeLog 2005-06-23 20:51:26 UTC
(rev 46451)
+++ trunk/mcs/class/System.Web/System.Web/ChangeLog 2005-06-23 20:55:20 UTC
(rev 46452)
@@ -1,3 +1,8 @@
+2005-06-23 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+ * HttpUtility.cs: the lower limit for using &#xx; encoding is 160, not
+ 128. Reset number back to 0 after use. Fixes bug #75365.
+
2005-06-19 Svetlana Zholkovsky <svetlanaz-at-mainsoft.com>
* In following classes added TARGET_J2EE or/and TARGET_JVM
directives:
Modified: trunk/mcs/class/System.Web/System.Web/HttpUtility.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/HttpUtility.cs 2005-06-23
20:51:26 UTC (rev 46451)
+++ trunk/mcs/class/System.Web/System.Web/HttpUtility.cs 2005-06-23
20:55:20 UTC (rev 46452)
@@ -760,9 +760,9 @@
output.Append (c);
entity.Length = 0;
} else {
+ number = 0;
if (c != '#') {
state = 2;
- number = 0;
} else {
state = 3;
}
@@ -850,13 +850,16 @@
output.Append (""");
break;
default:
- if ((int) c > 128) {
+ // MS starts encoding with &# from 160
and stops at 255.
+ // We don't do that. One reason is the
65308/65310 unicode
+ // characters that look like '<' and
'>'.
+ if (c > 159) {
output.Append ("&#");
- output.Append (((int)
c).ToString ());
+ output.Append (((int)
c).ToString (CultureInfo.InvariantCulture));
output.Append (";");
+ } else {
+ output.Append (c);
}
- else
- output.Append (c);
break;
}
return output.ToString ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches