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
7
7
{
8
8
public static int Main ( string [ ] args )
9
9
{
10
+ Extractor . SetInvariantCulture ( ) ;
11
+
10
12
return ( int ) Extractor . Run ( args ) ;
11
13
}
12
14
}
Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ public class Program
52
52
{
53
53
public static int Main ( string [ ] args )
54
54
{
55
+ Extractor . SetInvariantCulture ( ) ;
56
+
55
57
var options = Options . Create ( args ) ;
56
58
// options.CIL = true; // To do: Enable this
57
59
using var output = new ConsoleLogger ( options . Verbosity ) ;
Original file line number Diff line number Diff line change 11
11
using System . Threading . Tasks ;
12
12
using Semmle . Util . Logging ;
13
13
using System . Collections . Concurrent ;
14
+ using System . Globalization ;
15
+ using System . Threading ;
14
16
15
17
namespace Semmle . Extraction . CSharp
16
18
{
@@ -52,6 +54,21 @@ public void MissingSummary(int types, int namespaces) { }
52
54
public void MissingType ( string type ) { }
53
55
}
54
56
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
+
55
72
/// <summary>
56
73
/// Command-line driver for the extractor.
57
74
/// </summary>
You can’t perform that action at this time.
0 commit comments