Skip to content

Commit 816316e

Browse files
committed
Fix encoding!
1 parent 9a4c6af commit 816316e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/scripts/scriptlib.fsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ module Scripting =
2828
let ensureConsole () =
2929
if GetConsoleWindow() = IntPtr.Zero then
3030
AllocConsole() |> ignore
31+
// Set UTF-8 encoding for console input/output to ensure FSI receives UTF-8 data.
32+
// This is needed because on net472 ProcessStartInfo.StandardInputEncoding is unavailable,
33+
// so the spawned process inherits the console's encoding settings.
34+
Console.InputEncoding <- Text.UTF8Encoding(false)
35+
Console.OutputEncoding <- Text.UTF8Encoding(false)
3136
#endif
3237
#if NETCOREAPP
3338
let ensureConsole () = ()

0 commit comments

Comments
 (0)