Question:
I query a Quake3 masterserver via UDP, and get the response as below. As you can see, I had trouble figuring out the encoding of what the server sent... Is there any way to detect or set the receive encoding ?
baBuffer = new byte[1024*100]; // 100 kb should be enough
int recv = sctServerConnection.ReceiveFrom(baBuffer, ref tmpRemote);
Console.WriteLine("Message received from {0}:", tmpRemote.ToString());
System.Text.Encoding encResponseEncoding = System.Text.Encoding.Default; // Wrong...
//encResponseEncoding = System.Text.Encoding.ASCII;
//encResponseEncoding = System.Text.Encoding.UTF8;
//encResponseEncoding = System.Text.Encoding.GetEncoding(437); // ANSI-DOS
//encResponseEncoding = System.Text.Encoding.GetEncoding(1252);// ANSI-WestEurope
//encResponseEncoding = System.Text.Encoding.GetEncoding(1250); // Ansi-Centraleuro
//encResponseEncoding = System.Text.Encoding.GetEncoding("ISO-8859-1");
//encResponseEncoding = System.Text.Encoding.GetEncoding("ISO-8859-9");
//encResponseEncoding = System.Text.Encoding.UTF32;
encResponseEncoding = System.Text.Encoding.UTF7; // Bingo !