Skip to content

Commit 2197548

Browse files
committed
Set Console.OutputEncoding to UTF-8
Setting the OutputEncoding to Unicode caused characters to be written incorrectly in some cases. UTF-8 is the correct setting.
1 parent e5dff15 commit 2197548

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/PowerShellEditorServices/Session/SessionPSHostUserInterface.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ public ConsoleServicePSHostUserInterface(bool enableConsoleRepl)
6565
{
6666
if (enableConsoleRepl)
6767
{
68-
// Set the output encoding to Unicode so that all
69-
// Unicode characters are written correctly
70-
System.Console.OutputEncoding = System.Text.Encoding.Unicode;
68+
// Set the output encoding to UTF-8 so that special
69+
// characters are written to the console correctly
70+
System.Console.OutputEncoding = System.Text.Encoding.UTF8;
7171
}
7272

7373
this.rawUserInterface =

0 commit comments

Comments
 (0)