Hi all,

I've found what I think is a bug in System.Xml.XmlConvert. The methods "ToSingle" and "ToDouble" are currently parsing string values using the current system culture, and according to the documentation, this methods should be locale independent.

I prepared a patch, which solves the problem.

Cheers,

Rodolfo

--- XmlConvert.cs.original      2004-02-03 21:33:31.000000000 +0100
+++ XmlConvert.cs       2004-02-03 21:47:32.000000000 +0100
@@ -247,7 +247,7 @@
                                return Double.NegativeInfinity;
                        if (s == "NaN")
                                return Double.NaN;
-                       return Double.Parse (s, floatStyle);
+                       return Double.Parse (s, floatStyle, 
CultureInfo.InvariantCulture);
                }

                public static Guid ToGuid(string s)
@@ -286,7 +286,7 @@
                                return Single.NegativeInfinity;
                        if (s == "NaN")
                                return Single.NaN;
-                       return Single.Parse(s, floatStyle);
+                       return Single.Parse(s, floatStyle, 
CultureInfo.InvariantCulture);
                }

public static string ToString(Guid value)

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail


_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to