I have created a simple MUD client that has finally managed to connect to the server. However, I'm getting a bunch of unrecognizable characters in my output window.
I have highlighted some of the characters on this screenshot. I believe most of these are colorcodes, some are hyperlinks. Some might even be newline characters.
I think that the charset on the server is ASCII (it can be changed by the user.) Here is the code that presents the text in my client:
private void getDataFromServer() {
byte[] bytesToRead = new byte[client.ReceiveBufferSize];
int bytesRead = nwStream.Read(bytesToRead, 0, client.ReceiveBufferSize);
updateOutputWindow(Encoding.ASCII.GetString(bytesToRead, 0, bytesRead));
}
private void updateOutputWindow(string text) {
if (InvokeRequired) {
Invoke(new MethodInvoker(delegate () {
updateOutputWindow(text);
}));
}
else {
rtb_outputWindow.AppendText(text);
MessageBox.Show(text);
}
}
Is it possible to somehow interpret these characters?