mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 05:05:05 +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");
|
throw new ArgumentNullException("bytes");
|
||||||
|
|
||||||
byte[] cast = bytes as byte[] ?? bytes.ToArray();
|
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>
|
/// <summary>
|
||||||
@@ -143,7 +143,7 @@ namespace ICD.Common.Utils
|
|||||||
throw new ArgumentNullException("bytes");
|
throw new ArgumentNullException("bytes");
|
||||||
|
|
||||||
byte[] cast = bytes as byte[] ?? bytes.ToArray();
|
byte[] cast = bytes as byte[] ?? bytes.ToArray();
|
||||||
return Encoding.UTF8.GetString(cast, 0, length);
|
return Encoding.GetEncoding(28591).GetString(cast, 0, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -154,7 +154,7 @@ namespace ICD.Common.Utils
|
|||||||
[PublicAPI]
|
[PublicAPI]
|
||||||
public static byte[] ToBytes(string input)
|
public static byte[] ToBytes(string input)
|
||||||
{
|
{
|
||||||
return Encoding.UTF8.GetBytes(input);
|
return Encoding.GetEncoding(28591).GetBytes(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user