Jim Bassett
July 19th, 2005, 04:34 PM
The following simple code does not work(sY is empty). Does anyone have an idea why. This is using .NET 1.1
Encoding u8 = Encoding.UTF8;
string sX = "\x92"; // WORKS!
byte[] byteOne = new byte[1];
byteOne[0] = (byte)146;
string sY = u8.GetString(byteOne); // NOIE WORKIE!
sX works fine because it has the hex value in the string, but sY converting from the byte array doesn't (it's empty).
Encoding u8 = Encoding.UTF8;
string sX = "\x92"; // WORKS!
byte[] byteOne = new byte[1];
byteOne[0] = (byte)146;
string sY = u8.GetString(byteOne); // NOIE WORKIE!
sX works fine because it has the hex value in the string, but sY converting from the byte array doesn't (it's empty).