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)
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 }
You can’t perform that action at this time.
0 commit comments