Java application reads mssql table data (unicode data) and forward to servlet. This scenario works fine when I run application in Ubuntu. But performance changes for these following scenarios:
secnario1: i move java application to windows which forwards database data to servlet running in ubuntu. Output in java app shows question marks (unicode issue) but servlet shows them correctly.
Scenario2: move both java app and servlet to windows, now both modules displaying question marks.
What I think - it should not be problem with database data since jdbc driver in linux works fine. But when I read data from windows (using same driver, later different versions of jdbc driver), though it shows ?? but servlet in linux could manage to get unicode data. What could be the problem and what should I do?
Where does it show question marks? Some kind of console? A web page? A console most likely can't display those characters. A web page needs to specify the proper encoding.
Make sure that you're specifying UTF-8 as the encoding wherever the data gets sent from one system to another.
Joined: Sep 17, 2008
For java app, I log output into file, and I run servlet in tomcat from eclipse - so, can see output in eclipse console.
I guess i figured out the problem. It was not jdbc driver problem. I changed Standards and Formats in Regional and Language settings (windows control panel) to Thai (before it was english) and now java app logs unicode data (read from mssql table) properly in log file. But eclipse console still show question marks. Later, I switched to jetty, and eclipse console prints Thai character properly. It was tomcat limitation. Adding UTF-8 for url handling in server.xml in tomcat solved the problem.
Worth to note that I was using apache HttpClient to forward data to servlet.