So I am trying to make a modification to some software that is written in C# but I am not really a developer. The code reads data from a client and gets values from it. The problem I am seeing is that when you have values from the client that use non english characters it becomes jibberish. The code in question is:
public static string ReadNT(BinaryReader stream)
{
ret = "";
byte addByte = 0x00;
do {
addByte = ReadByte(stream);
if (addByte != 0x00)
ret += (char)addByte;
} while (addByte != 0x00);
return ret;
}
As far as I can tell it is going through the stream and converting things to a character one by one to get the string. The problem with that is it doesn't work with unicode/utf8. Is there a way to convert this into a string that works with utf8 values?