Skip to content

Commit 0cc6c4d

Browse files
committed
Fix encoding
1 parent 1ee89a1 commit 0cc6c4d

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

Main.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Diagnostics;
55
using System.IO;
66
using System.Linq;
7+
using System.Text;
78
using System.Text.RegularExpressions;
89
using System.Threading;
910
using System.Threading.Tasks;
@@ -17,8 +18,8 @@ public class AppUpgrader : IAsyncPlugin, ISettingProvider
1718
{
1819
private SettingsPage settingsPage;
1920
internal PluginInitContext Context;
20-
private ConcurrentBag<UpgradableApp> allUpgradableApps;
21-
private ConcurrentBag<UpgradableApp> upgradableApps;
21+
private ConcurrentBag<UpgradableApp> allUpgradableApps;
22+
private ConcurrentBag<UpgradableApp> upgradableApps;
2223
private ConcurrentDictionary<string, string> appIconPaths;
2324
private readonly SemaphoreSlim _refreshSemaphore = new SemaphoreSlim(1, 1);
2425
private DateTime _lastRefreshTime = DateTime.MinValue;
@@ -45,7 +46,7 @@ public async Task InitAsync(PluginInitContext context)
4546
settingsPage = new SettingsPage(Context);
4647
settingsPage.SettingLoaded += async (s, e) =>
4748
{
48-
settingsPage.ExcludedApps.CollectionChanged += (s,e)=> ApplyExclusionFilter();
49+
settingsPage.ExcludedApps.CollectionChanged += (s, e) => ApplyExclusionFilter();
4950
RemoveExcludedAppsFromUpgradableList();
5051
};
5152
});
@@ -55,7 +56,7 @@ public async Task InitAsync(PluginInitContext context)
5556
{
5657
await RefreshUpgradableAppsAsync();
5758
}
58-
catch (Exception ex){}
59+
catch (Exception ex) { }
5960
});
6061

6162
ThreadPool.SetMinThreads(Environment.ProcessorCount * 2, Environment.ProcessorCount * 2);
@@ -75,7 +76,7 @@ private void RemoveExcludedAppsFromUpgradableList()
7576
var updatedApps = upgradableApps
7677
.Where(app => !excludedApps.Any(excludedApp =>
7778
app.Name.Contains(excludedApp, StringComparison.OrdinalIgnoreCase) ||
78-
app.Id.Contains(excludedApp, StringComparison.OrdinalIgnoreCase)))
79+
app.Id.Contains(excludedApp, StringComparison.OrdinalIgnoreCase)))
7980
.ToList();
8081

8182
upgradableApps = new ConcurrentBag<UpgradableApp>(updatedApps);
@@ -133,7 +134,7 @@ public async Task<List<Result>> QueryAsync(Query query, CancellationToken token)
133134
await PerformUpgradeAsync(app);
134135
}
135136
}
136-
catch (Exception ex){}
137+
catch (Exception ex) { }
137138
});
138139
return true;
139140
}
@@ -310,7 +311,7 @@ await Task.Run(() =>
310311
return result;
311312
}
312313
}
313-
catch (Exception ex){}
314+
catch (Exception ex) { }
314315

315316
return "Images\\app.png";
316317
}
@@ -436,7 +437,9 @@ private static async Task<string> ExecuteWingetCommandAsync(string command, Canc
436437
RedirectStandardOutput = true,
437438
RedirectStandardError = true,
438439
UseShellExecute = false,
439-
CreateNoWindow = true
440+
CreateNoWindow = true,
441+
StandardOutputEncoding = Encoding.UTF8,
442+
StandardErrorEncoding = Encoding.UTF8
440443
};
441444

442445
using var process = Process.Start(processInfo);

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"Name": "AppUpgrader",
55
"Description": "Allows you to keep your applications up using winget",
66
"Author": "Exarilo",
7-
"Version": "1.1.4",
7+
"Version": "1.1.5",
88
"Language": "csharp",
99
"Website": "https://github.com/Exarilo/Flow.Launcher.Plugin.AppUpgrader",
1010
"IcoPath": "Images\\app.png",

0 commit comments

Comments
 (0)