From 8ec5cfc5b99695a6ddccbf78d26551c9c8ce3b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brandon=20Pi=C3=B1a?= Date: Sat, 27 Jan 2024 13:00:33 -0600 Subject: [PATCH] override culture of thread to potentially resolve locale issues with reading xml file --- vmaf-gui/results.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vmaf-gui/results.cs b/vmaf-gui/results.cs index e26d08e..6908521 100644 --- a/vmaf-gui/results.cs +++ b/vmaf-gui/results.cs @@ -1,6 +1,8 @@ using System; using System.Data; +using System.Globalization; using System.Linq; +using System.Threading; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using System.Xml.Linq; @@ -16,7 +18,11 @@ public results() public void showResults(string path) { - var doc = XDocument.Load(path); + // Override culture of the current thread to possibly resolve locale issues with loading xml file + CultureInfo culture = new CultureInfo("en-US"); + Thread.CurrentThread.CurrentCulture = culture; + + var doc = XDocument.Load(path); var frames = from frame in doc.Root.Descendants("frame") select frame;