mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
Switched to extended ASCII encoding for string <-> byte[] conversion
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user