Hi friends,
I'm facing a strange problem over here. I'm trying to post a request to HttpServlet.
In between I have a small
JAVA application which reads the request body from imputStream and streams the same(along with headers) to the
servlet.
Due to legacy reasons we are using BufferedReader and thus read in achar array instead of byte.
This all works fine till I post a request containing Hebrew characters, in which case when I stream the request to servlet, the Hebrew charactes are changed and thus take more bytes than original Content-Length header.
I have tried System.setProperty("file.encoding", "UTF-8") and also setProperty("sun.jnu.encoding", "UTF-8") without any luck.
One thing which blows me off is if I set LANG variable in Linux to have UTF-8 as character encoding(ex en_US.UTF-8 ), this all works fine and characters are not converted. Any encoding apart from UTF-8 fails, but I dont understand the dependency on OS level Lang parameter given that many sites quote that streams in java are converted from file.encoding to unicode and viceverca
Any suggestions and help in this is highly appreciated.
Regards,
Mayank[/color]