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 5
5
using System . IO ;
6
6
using System . IO . Pipes ;
7
7
using System . Security . Principal ;
8
+ using System . Text ;
8
9
9
10
namespace Files . App . Services . PreviewPopupProviders
10
11
{
@@ -30,13 +31,14 @@ public async Task SwitchPreviewAsync(string path)
30
31
private async Task DoPreviewAsync ( string path , string message )
31
32
{
32
33
string pipeName = $ "QuickLook.App.Pipe.{ WindowsIdentity . GetCurrent ( ) . User ? . Value } ";
34
+ var encoding = Encoding . GetEncoding ( "UTF-8" , new EncoderReplacementFallback ( "?" ) , new DecoderExceptionFallback ( ) ) ;
33
35
34
36
await using var client = new NamedPipeClientStream ( "." , pipeName , PipeDirection . Out ) ;
35
37
try
36
38
{
37
39
await client . ConnectAsync ( TIMEOUT ) ;
38
40
39
- await using var writer = new StreamWriter ( client ) ;
41
+ await using var writer = new StreamWriter ( client , encoding ) ;
40
42
await writer . WriteLineAsync ( $ "{ message } |{ path } ") ;
41
43
await writer . FlushAsync ( ) ;
42
44
}
You can’t perform that action at this time.
0 commit comments