Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Windows-1252
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
Windows-1252
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01153643
Message ID:
01153643
Views:
49
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.
Next
Reply
Map
View

Click here to load this message in the networking platform