From 6945b3f8d5fe467c1e39b3e371116bb5215d8214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 4 Feb 2016 02:37:36 +0100 Subject: [monodoc] Fix literal formatting on systems where decimal separator is not a dot E.g. on a German language OS the "make check-mdoc-export-html" test fails with this: ``` diff --exclude=.svn -rup Test/en.expected/Mono.DocTest/Widget.xml Test/en.actual/Mono.DocTest/Widget.xml --- Test/en.expected/Mono.DocTest/Widget.xml 2015-11-18 04:42:11.000000000 +0100 +++ Test/en.actual/Mono.DocTest/Widget.xml 2016-02-04 02:38:09.000000000 +0100 @@ -1061,8 +1061,8 @@ - - + + Field 0.0.0.0 @@ -1070,7 +1070,7 @@ System.Double - 3.14159 + 3,14159 ``` The fix is to always use InvariantCulture for literal formatting. --- mdoc/Mono.Documentation/monodocer.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mdoc/Mono.Documentation/monodocer.cs b/mdoc/Mono.Documentation/monodocer.cs index f1b98213..a8f1ccc5 100644 --- a/mdoc/Mono.Documentation/monodocer.cs +++ b/mdoc/Mono.Documentation/monodocer.cs @@ -2067,7 +2067,7 @@ class MDocUpdater : MDocCommand if (val == null) value = "null"; else if (val is Enum) value = val.ToString(); else if (val is IFormattable) { - value = ((IFormattable)val).ToString(); + value = ((IFormattable)val).ToString(null, CultureInfo.InvariantCulture); if (val is string) value = "\"" + value + "\""; } @@ -4966,7 +4966,7 @@ class ILFullMemberFormatter : MemberFormatter { .Append (val.ToString ()) .Append (')'); else if (val is IFormattable) { - string value = ((IFormattable)val).ToString(); + string value = ((IFormattable)val).ToString(null, CultureInfo.InvariantCulture); buf.Append (" = "); if (val is string) buf.Append ("\"" + value + "\""); @@ -5525,7 +5525,7 @@ class CSharpFullMemberFormatter : MemberFormatter { else if (val is Enum) buf.Append (" = ").Append (val.ToString ()); else if (val is IFormattable) { - string value = ((IFormattable)val).ToString(); + string value = ((IFormattable)val).ToString(null, CultureInfo.InvariantCulture); if (val is string) value = "\"" + value + "\""; buf.Append (" = ").Append (value); -- cgit v1.2.3