Converting byte to string c#
Does anybody know how to covert a byte array to a string in C#? I want each byte in the array to represent an ASCII character in the resulting string.
Perhaps the System.Text.Encoding.ASCII.GetString method, or similar.
Ahh ok. That'll work.
yup. everything is in the .net framework somewhere.
If you want each byte to be mapped directly to the corresponding Unicode character, use the ISO-8859-1 encoding (aka Latin-1 aka Code Page 28591):
...but note that this encoding is somewhat different from the popular Windows 1252 ("Western", "Windows ANSI"), just in case that's your string's encoding!
"there is no class to support some other encodings (windows 1252 perhaps..."
thanks for the correction. wonder if i found that when i had the problem, i don't remember the details any more.
Fog Creek Home