From 809fe6802b99c3aca85cc1c8e4c94bf9411c1c11 Mon Sep 17 00:00:00 2001 From: "jeffery.thompson" Date: Tue, 18 Jul 2017 10:00:24 -0400 Subject: [PATCH] Switched to extended ASCII encoding for string <-> byte[] conversion --- ICD.Common.Utils/StringUtils.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ICD.Common.Utils/StringUtils.cs b/ICD.Common.Utils/StringUtils.cs index e339eaf..4a18951 100644 --- a/ICD.Common.Utils/StringUtils.cs +++ b/ICD.Common.Utils/StringUtils.cs @@ -127,7 +127,7 @@ namespace ICD.Common.Utils throw new ArgumentNullException("bytes"); byte[] cast = bytes as byte[] ?? bytes.ToArray(); - return Encoding.UTF8.GetString(cast, 0, cast.Length); + return Encoding.GetEncoding(28591).GetString(cast, 0, cast.Length); } /// @@ -143,7 +143,7 @@ namespace ICD.Common.Utils throw new ArgumentNullException("bytes"); byte[] cast = bytes as byte[] ?? bytes.ToArray(); - return Encoding.UTF8.GetString(cast, 0, length); + return Encoding.GetEncoding(28591).GetString(cast, 0, length); } /// @@ -154,7 +154,7 @@ namespace ICD.Common.Utils [PublicAPI] public static byte[] ToBytes(string input) { - return Encoding.UTF8.GetBytes(input); + return Encoding.GetEncoding(28591).GetBytes(input); } ///