diff --git a/Agent/Phantom.Agent/Program.cs b/Agent/Phantom.Agent/Program.cs index 0543439..ab2def9 100644 --- a/Agent/Phantom.Agent/Program.cs +++ b/Agent/Phantom.Agent/Program.cs @@ -18,12 +18,13 @@ const int ProtocolVersion = 1; var shutdownCancellationTokenSource = new CancellationTokenSource(); var shutdownCancellationToken = shutdownCancellationTokenSource.Token; +ProgramCulture.UseInvariantCulture(); +ThreadPool.SetMinThreads(workerThreads: 2, completionPortThreads: 1); + PosixSignals.RegisterCancellation(shutdownCancellationTokenSource, static () => { PhantomLogger.Root.InformationHeading("Stopping Phantom Panel agent..."); }); -ThreadPool.SetMinThreads(workerThreads: 2, completionPortThreads: 1); - try { var fullVersion = AssemblyAttributes.GetFullVersion(Assembly.GetExecutingAssembly()); diff --git a/Controller/Phantom.Controller/Program.cs b/Controller/Phantom.Controller/Program.cs index 70a051c..63be6eb 100644 --- a/Controller/Phantom.Controller/Program.cs +++ b/Controller/Phantom.Controller/Program.cs @@ -15,6 +15,8 @@ using Phantom.Utils.Tasks; var shutdownCancellationTokenSource = new CancellationTokenSource(); var shutdownCancellationToken = shutdownCancellationTokenSource.Token; +ProgramCulture.UseInvariantCulture(); + PosixSignals.RegisterCancellation(shutdownCancellationTokenSource, static () => { PhantomLogger.Root.InformationHeading("Stopping Phantom Panel controller..."); }); diff --git a/Utils/Phantom.Utils/Runtime/ProgramCulture.cs b/Utils/Phantom.Utils/Runtime/ProgramCulture.cs new file mode 100644 index 0000000..01698b4 --- /dev/null +++ b/Utils/Phantom.Utils/Runtime/ProgramCulture.cs @@ -0,0 +1,13 @@ +using System.Globalization; + +namespace Phantom.Utils.Runtime; + +public static class ProgramCulture { + public static void UseInvariantCulture() { + CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture; + CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture; + + CultureInfo.CurrentCulture = CultureInfo.InvariantCulture; + CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture; + } +} diff --git a/Web/Phantom.Web/Program.cs b/Web/Phantom.Web/Program.cs index 1ac8e44..34c9b2a 100644 --- a/Web/Phantom.Web/Program.cs +++ b/Web/Phantom.Web/Program.cs @@ -17,6 +17,8 @@ using Phantom.Web.Services.Rpc; var shutdownCancellationTokenSource = new CancellationTokenSource(); var shutdownCancellationToken = shutdownCancellationTokenSource.Token; +ProgramCulture.UseInvariantCulture(); + PosixSignals.RegisterCancellation(shutdownCancellationTokenSource, static () => { PhantomLogger.Root.InformationHeading("Stopping Phantom Panel web..."); });