Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A special character is appended before §

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.

like image 769
HashimR Avatar asked Jan 17 '12 04:01

HashimR


People also ask

What does it mean to add a special character?

A special character is one that is not considered a number or letter. Symbols, accent marks, and punctuation marks are considered special characters.

What is the special character & used for?

In film credits for stories, screenplays, etc., & indicates a closer collaboration than and. The ampersand is used by the Writers Guild of America to denote two writers collaborating on a specific script, rather than one writer rewriting another's work.


1 Answers

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")

like image 86
Ted Hopp Avatar answered Oct 01 '22 17:10

Ted Hopp