• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

MSSQL and Unicode in WIndows and Linux

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

Thank you in advance.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ahsan Habib
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic