Skip to content

Commit

Permalink
Fix code page not being loaded properly (fix #2659)
Browse files Browse the repository at this point in the history
  • Loading branch information
marticliment committed Aug 28, 2024
1 parent aeadddb commit d3f18bc
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/UniGetUI.Core.Data/CoreData.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Diagnostics;
using System.Net;
using System.Runtime.InteropServices.JavaScript;
using UniGetUI.Core.Logging;

namespace UniGetUI.Core.Data
Expand All @@ -25,7 +26,17 @@ private static int GetCodePage()
};
p.Start();
string contents = p.StandardOutput.ReadToEnd();
return int.Parse(contents.Split(':')[^1].Trim());
string purifiedString = "";

foreach (var c in contents.Split(':')[^1].Trim())
{
if (c >= '0' && c <= '9')
{
purifiedString += c;
}
}

return int.Parse(purifiedString);
}
catch (Exception e)
{
Expand Down

0 comments on commit d3f18bc

Please sign in to comment.