Incorrect XML serialization in different regions [PATCH]

Bug #1050912 reported by Marc Palmans
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
WPF-Math
New
Undecided
Unassigned

Bug Description

In some regions the comma and period have different meanings when used in numbers

index d9fc79d..3cf1f61 100644
--- a/WpfMath/XmlUtilities.cs
+++ b/WpfMath/XmlUtilities.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Xml.Linq;
+using System.Globalization;

 namespace WpfMath
 {
@@ -41,7 +42,7 @@ namespace WpfMath
                     return defaultValue.Value;
                 throw new InvalidOperationException();
             }
- return double.Parse(attribute.Value);
+ return double.Parse(attribute.Value, CultureInfo.InvariantCulture);
         }

         public static string AttributeValue(this XElement element, string attributeName, string defaultValue = null)

Revision history for this message
Friedrich von Never (friedrich-v) wrote :

Hello. Please note that the analogous patch was just merged into the project fork: https://github.com/ForNeVeR/wpf-math/pull/7

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.