Reputation: 11
I trying to build server in Java, the clients send some specific message with special charectars like FS, ESC and GS. When i view the messages in notepad ++, I get the charectars shown properly as per below picture:
When I receive the message in Java and try to output it in the text area, these charectars are not shown as per below:
I am using Java command socketIn.readUTF() to read the message from the socket, can someone please tell me how I can show the message in Java UI like notepad ++.
Thanks,
Ahmed.
Upvotes: 1
Views: 236
Reputation: 3003
You are asking how to print non printable characters.
So, as they are not printable, you just can't.
But if you like the notepad++ solution to this problem, you should do the same as they had done.
Maybe, parse the string you want to show, and change the charaters with the FS, ESC and GS.
But take care of the fact you have to handle the real string and the shown one. So for example for the copy & past.
Upvotes: 1