File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ public static class Driver
77 {
88 public static int Main ( string [ ] args )
99 {
10+ Extractor . SetInvariantCulture ( ) ;
11+
1012 return ( int ) Extractor . Run ( args ) ;
1113 }
1214 }
Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ public class Program
5252 {
5353 public static int Main ( string [ ] args )
5454 {
55+ Extractor . SetInvariantCulture ( ) ;
56+
5557 var options = Options . Create ( args ) ;
5658 // options.CIL = true; // To do: Enable this
5759 using var output = new ConsoleLogger ( options . Verbosity ) ;
Original file line number Diff line number Diff line change 1111using System . Threading . Tasks ;
1212using Semmle . Util . Logging ;
1313using System . Collections . Concurrent ;
14+ using System . Globalization ;
15+ using System . Threading ;
1416
1517namespace Semmle . Extraction . CSharp
1618{
@@ -52,6 +54,21 @@ public void MissingSummary(int types, int namespaces) { }
5254 public void MissingType ( string type ) { }
5355 }
5456
57+ /// <summary>
58+ /// Set the application culture to the invariant culture.
59+ ///
60+ /// This is required among others to ensure that the invariant culture is used for value formatting during TRAP
61+ /// file writing.
62+ /// </summary>
63+ public static void SetInvariantCulture ( )
64+ {
65+ var culture = CultureInfo . InvariantCulture ;
66+ CultureInfo . DefaultThreadCurrentCulture = culture ;
67+ CultureInfo . DefaultThreadCurrentUICulture = culture ;
68+ Thread . CurrentThread . CurrentCulture = culture ;
69+ Thread . CurrentThread . CurrentUICulture = culture ;
70+ }
71+
5572 /// <summary>
5673 /// Command-line driver for the extractor.
5774 /// </summary>
You can’t perform that action at this time.
0 commit comments