mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
Switched to extended ASCII encoding for string <-> byte[] conversion
This commit is contained in:
parent
4801d45347
commit
809fe6802b
1 changed files with 3 additions and 3 deletions
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue