44using System . Diagnostics ;
55using System . IO ;
66using System . Linq ;
7+ using System . Text ;
78using System . Text . RegularExpressions ;
89using System . Threading ;
910using 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 ) ;
0 commit comments