From 509e0cbf1950489c7afdaedfcbe8b0de78b7920f Mon Sep 17 00:00:00 2001 From: Berkan Diler Date: Tue, 28 Feb 2023 14:36:26 +0100 Subject: [PATCH] Use C# 11 UTF-8 string literals --- .../engine/remoting/common/RemoteSessionHyperVSocket.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs b/src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs index e71c5e82581..126004da829 100644 --- a/src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs +++ b/src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs @@ -551,13 +551,13 @@ public bool Connect( // if (emptyPassword) { - HyperVSocket.Send(Encoding.ASCII.GetBytes("EMPTYPW")); + HyperVSocket.Send("EMPTYPW"u8); HyperVSocket.Receive(response); responseString = Encoding.ASCII.GetString(response); } else { - HyperVSocket.Send(Encoding.ASCII.GetBytes("NONEMPTYPW")); + HyperVSocket.Send("NONEMPTYPW"u8); HyperVSocket.Receive(response); HyperVSocket.Send(password); @@ -590,11 +590,11 @@ public bool Connect( { if (emptyConfiguration) { - HyperVSocket.Send(Encoding.ASCII.GetBytes("EMPTYCF")); + HyperVSocket.Send("EMPTYCF"u8); } else { - HyperVSocket.Send(Encoding.ASCII.GetBytes("NONEMPTYCF")); + HyperVSocket.Send("NONEMPTYCF"u8); HyperVSocket.Receive(response); byte[] configName = Encoding.Unicode.GetBytes(configurationName);