File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -31,18 +31,17 @@ public async Task SwitchPreviewAsync(string path)
31
31
private async Task DoPreviewAsync ( string path , string message )
32
32
{
33
33
string pipeName = $ "QuickLook.App.Pipe.{ WindowsIdentity . GetCurrent ( ) . User ? . Value } ";
34
- var encoding = Encoding . GetEncoding ( "UTF-8" , new EncoderReplacementFallback ( "?" ) , new DecoderExceptionFallback ( ) ) ;
35
34
36
35
await using var client = new NamedPipeClientStream ( "." , pipeName , PipeDirection . Out ) ;
37
36
try
38
37
{
39
38
await client . ConnectAsync ( TIMEOUT ) ;
40
39
41
- await using var writer = new StreamWriter ( client , encoding ) ;
40
+ await using var writer = new StreamWriter ( client ) ;
42
41
await writer . WriteLineAsync ( $ "{ message } |{ path } ") ;
43
42
await writer . FlushAsync ( ) ;
44
43
}
45
- catch ( Exception ex ) when ( ex is TimeoutException or IOException )
44
+ catch ( Exception ex ) when ( ex is TimeoutException or IOException or EncoderFallbackException )
46
45
{
47
46
// ignore
48
47
}
You can’t perform that action at this time.
0 commit comments