From efd6005fc72aea2da94fe418d0b1dbab6e0e7950 Mon Sep 17 00:00:00 2001 From: tebjan Date: Tue, 15 Jul 2014 17:10:04 +0200 Subject: [PATCH] color converter now uses invariant culture to parse --- Source/Painting/SvgColourConverter.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/Painting/SvgColourConverter.cs b/Source/Painting/SvgColourConverter.cs index f5bdbc1..278f9d7 100644 --- a/Source/Painting/SvgColourConverter.cs +++ b/Source/Painting/SvgColourConverter.cs @@ -1,9 +1,10 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Drawing; using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading; namespace Svg { @@ -31,6 +32,9 @@ namespace Svg if (colour != null) { + var oldCulture = Thread.CurrentThread.CurrentCulture; + Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; + colour = colour.Trim(); if (colour.StartsWith("rgb")) @@ -79,6 +83,8 @@ namespace Svg colour = string.Format(culture, "#{0}{0}{1}{1}{2}{2}", colour[1], colour[2], colour[3]); return base.ConvertFrom(context, culture, colour); } + + Thread.CurrentThread.CurrentCulture = oldCulture; } return base.ConvertFrom(context, culture, value); -- GitLab