kevin-montrose/Jil — pull request #10 by DavidKarlas (2014-02-01 23:27:27+00:00)
Title: Using InvariantCulture instead of Threads culture to Deserialize data

On computers with culture where decimal separator is not dot but comma(de-DE for example). Jil serialized with comma. This commit is only fixing Deserializing and not Serializing.

Problem with serializing is that is using StringWriter.Write which has property FormatProvider but this can only be set in constructor which is constructed outside Jil code(user creates it) and sends to Jil. I will leave this one to you Kevin since seems like breaking change. To test this you can do this I think:

At start of test like Primitive add this line:
```csharp
[TestMethod]
public void Primitive()
{
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de-DE");
```

Since we are all about speed and stuff I also checked what this means for performance... Seems like even some boost is achieved :)

```csharp
static void Main(string[] args)
{
int LOOPS = 10000000;
for (int j = 0; j < 10; j++)
{
{
Stopwatch SW = Stopwatch.StartNew();
for (double i = 0; i < LOOPS; i++)
{
double.Parse(i.ToString(CultureInfo.InvariantCulture), CultureInfo.InvariantCulture);
}
SW.Stop();
Console.WriteLine("Invariant:" + SW.ElapsedMilliseconds);
}
{
Stopwatch SW = Stopwatch.StartNew();
for (double i = 0; i < LOOPS; i++)
{
double.Parse(i.ToString());
}
SW.Stop();
Console.WriteLine("Thread :" + SW.ElapsedMilliseconds);
}
}
Console.ReadLine();
}
```

```
Invariant:3542
Thread :3731
Invariant:3536
Thread :3718
Invariant:3540
Thread :3726
Invariant:3536
Thread :3710
Invariant:3540
Thread :3723
```