I receive an array of bytes that is supposed to represent a string of characters. The characters are coded using Windows-1252 character encoding.
I have two tasks:
1) Convert the byte array to a string.
2) Change the string and create a new byte array.
Until now I have been using the following code:
string myString = ASCIIEncoding.ASCII.GetString(byteArray);
byte[] byteArray = ASCIIEncoding.ASCII.GetBytes(myString);
Now all was well until someone sent be a byte that was greater than 0x7F.
Does anyone know how I can convert a byte array to a string using the Windows-1252 character encoding and then convert back?
Thanks,
Einar
Semper ubi sub ubi.