On 1/16/2014 7:23 PM, Тимур Кулибаев wrote: > Hello, Chris ! Thank you for your response. Below are answers to your > questions. > > +++If the data is correctly-stored in the database (as verified by some > +++other means), does the fetched-data display correctly in your web pages? > > Yes, data is displayed correctly in web-pages. Only problem is that with Tomcat 7 > Kazakh letters are not displayed correctly. But with Oracle Application Server > all data including Kazakh letters are displayed correctly. > > +++If it's not displaying correctly, please tell us what the Content-Type > +++HTTP response header is for the page (specifically, the character > +++encoding). > > For Tomcat 7: lang="ru-RU", content="Oracle UIX", charset="UTF-8" type="text/css" > inside of pages I can see that all user data is in UTF-8 - we need force Tomcat works > in Windows-1251 > > For Oracle AS: lang="ru", content="Oracle UIX", charset="UTF-8" type="text/css" > inside of pages I can see that all user data is in Windows-1251 that is correct. > > I don't know from where servlet takes charset="UTF-8" as its web.xml sets Windows-1251 > as servlet default codepage. Looking through servlet source code there is not explicit > HttpServletResponse.setContentType(....). May be it comes from UIX configuration tables > residing in database, I'll ask developers about it and let you know. > > +++Also, please tell us what the character encoding is for the > +++/database connection/ to Oracle (the one made from your application to Oracle). > Database has CL8MSWIN1251 as default codepage and character encoding for the database > connection to Oracle is also CL8MSWIN1251. > > +++Finally, how are you connecting to Oracle? Are you using a > +++Tomcat-configured DataSource or is your web application configuring > +++things on its own? > > DataSource is not used. My web-application reads jdbc-connection string from web.xml: > <init-param> > <param-name>kz.ft.uix.app.driver</param-name> > <param-value>jdbc:oracle:thin:@10.1.102.124:1526:fb</param-value> > </init-param> > > > +++I can see that when you attempt to use user.language=ru and > +++user.country=kz, you get this error from Oracle's driver: > > +++> org.apache.catalina.core.ApplicationContext log MESSAGE = > +++> ORA-00604: error occurred at recursive SQL level 1 ORA-12705: > +++> invalid or unknown NLS parameter value specified , ERRORCODE = 604 > > +++Can you give us the whole stack trace from that? > > First I generated list of all available locales based on java-code given here http://www.avajava.com/tutorials/lessons/how-do-i-display-all-available-locales.html;jsessionid=0F8CED6D22D750F6C83FD9477A3A874D > see attached available locales list and one does not contain "kz" > so driver cannot understand this incorrect setting. When set "-Duser.language=ru > -Duser.country=RU" than no errors, all is ok, only Kazakh letters displayed > incorrectly. Tomcat 7 and Oracle AS uses the same jdbc-driver ojdbc14.jar from > Oracle AS. Operation systems of hosts have the same configuration. > > Oracle AS works in Windows-1251, it sends user data from database to browser in > Windows-1251. Tomcat 7 works in UTF-8 , it sends user data from database to browser in UTF-8, > t's the root of the trouble. How to make Tomcat 7 works in Windows-1251 ? > > Thank you, > wating for your answer, > Timur
Hi, Timur- To send a response using the Windows 1251 character set, the character encoding of the response should be set somewhere. Information about the setContentType method of HttpServletResponse, which may be used to set the character encoding of the response, may be found here: http://docs.oracle.com/javaee/7/api/javax/servlet/ServletResponse.html Information about the JSP page directive, which may also be used to set the character encoding of the response, may be found in the JavaServer Pages Specification. As an aside, there doesn't appear to be a body element in your HTML. It won't solve your problem, but, for more information, see: http://www.w3.org/TR/html401/struct/global.html -Terence Bandoian --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org