Skip to content

Commit 98c7408

Browse files
authored
Fix: Fixed QuickLook support (#16189)
1 parent 5fc70d3 commit 98c7408

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Files.App/Services/PreviewPopupProviders/QuickLookProvider.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,17 @@ public async Task SwitchPreviewAsync(string path)
3131
private async Task DoPreviewAsync(string path, string message)
3232
{
3333
string pipeName = $"QuickLook.App.Pipe.{WindowsIdentity.GetCurrent().User?.Value}";
34-
var encoding = Encoding.GetEncoding("UTF-8", new EncoderReplacementFallback("?"), new DecoderExceptionFallback());
3534

3635
await using var client = new NamedPipeClientStream(".", pipeName, PipeDirection.Out);
3736
try
3837
{
3938
await client.ConnectAsync(TIMEOUT);
4039

41-
await using var writer = new StreamWriter(client, encoding);
40+
await using var writer = new StreamWriter(client);
4241
await writer.WriteLineAsync($"{message}|{path}");
4342
await writer.FlushAsync();
4443
}
45-
catch (Exception ex) when (ex is TimeoutException or IOException)
44+
catch (Exception ex) when (ex is TimeoutException or IOException or EncoderFallbackException)
4645
{
4746
// ignore
4847
}

0 commit comments

Comments
 (0)