File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 55using System . IO ;
66using System . IO . Pipes ;
77using System . Security . Principal ;
8+ using System . Text ;
89
910namespace Files . App . Services . PreviewPopupProviders
1011{
@@ -30,13 +31,14 @@ public async Task SwitchPreviewAsync(string path)
3031 private async Task DoPreviewAsync ( string path , string message )
3132 {
3233 string pipeName = $ "QuickLook.App.Pipe.{ WindowsIdentity . GetCurrent ( ) . User ? . Value } ";
34+ var encoding = Encoding . GetEncoding ( "UTF-8" , new EncoderReplacementFallback ( "?" ) , new DecoderExceptionFallback ( ) ) ;
3335
3436 await using var client = new NamedPipeClientStream ( "." , pipeName , PipeDirection . Out ) ;
3537 try
3638 {
3739 await client . ConnectAsync ( TIMEOUT ) ;
3840
39- await using var writer = new StreamWriter ( client ) ;
41+ await using var writer = new StreamWriter ( client , encoding ) ;
4042 await writer . WriteLineAsync ( $ "{ message } |{ path } ") ;
4143 await writer . FlushAsync ( ) ;
4244 }
You can’t perform that action at this time.
0 commit comments