I have a client application which is sending a request to a server. Server is fetching a field from a database and sending a java.lang.String response back to the client. Server is running on JBoss v5.0. The unusual thing is that, when server is running on Windows machine, the response received by the client is normal but when it is running on Linux there is some problem in the encoding.
This is the data in the database: "INET§IMPNG\n"
Response is correctly received when server running on Windows.
A special character is appended before § when the server is running on Linux. Is there any special thing i need to do at the server side. Any help would be appreciated.
EDIT:
The response received is : INET§IMPNG.
This is almost certainly a character encoding issue. To avoid mismatches between client and server, always specify a specific encoding and avoid the default encoding. (So, for instance, instead of
"xyz".getBytes(), use"xyz".getBytes("UTF-8")