Switched to extended ASCII encoding for string <-> byte[] conversion

This commit is contained in:
jeffery.thompson
2017-07-18 10:00:24 -04:00
parent 4801d45347
commit 809fe6802b

View File

@@ -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);
}
/// <summary>
@@ -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);
}
/// <summary>
@@ -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);
}
/// <summary>