Sockets and swedish Characters (åäöÅÄÖ)
Posted on 1998-01-21
I've got a problem with an applet that communicates with a server via a Socket connection. Here is the code for writing on the socket:
Socket s = new Socket(serverMachine, Globals.SERVER_PORT);
DataOutputStream outS =
Here is the code for reading on the socket (The server side): (on ServerSocket.accept() the following is don
String cmd = in.readUTF();
String name = in.readUTF();
String info = in.readUTF();
This works fine except that the swedish characters becomes something else. I use the read and write-UTF because this was the only method that I thought I could use when writing a string that contained \n in it.
Is it the UTF-format that's cousing the problem? If it is, is there anyother method I can use that works in the same way?
Is there any alternative way's of doing this? I don't want to use RMI, CORBA or DCOM!