Reputation:
I am trying to get Chinese characters from a SQL Server 2005 database server with my web application hosted with Jboss server on a Linux box (RHEL). The issue is that the Chinese characters never get returned from the database, showing some square boxes instead. I have tried both the JTDS drivers as well as the SqlJdbc drivers from Microsoft for this. Interestingly the same combination of database and drivers works fine in a Windows environment with the Chinese characters returned in a string from the result set.
Any help on the issue would be greatly appreciated.
Upvotes: 6
Views: 439
Reputation: 6881
There's not really enough info about what you're doing with the data between the time it comes out of the database, and the time it gets displayed in the view. It might be a good idea to print some debug information in both Linux and Windows to see what the differences are for certain System properties, like if you output System.getProperty("file.encoding") in both scenarios, what do you get?
You might want to try using JAVA_OPTS=-Dfile.encoding=UTF-8.
Perhaps the discussion at the link below might help.
https://community.jboss.org/thread/155260?_sscc=t
It doesn't sound like this is a database/driver related problem.
Upvotes: 1