ms access encoding problem ( connecting with jsp)
After searching for hours i could not find the solution, expecting help as,
I am connecting ms access database file (.mdb) from jsp using sun's jdbc driver and tomcat.
jsp page's charset is set to "iso-8859-1" (i have tried setting it utf-8 with no luck).
now storing user input 开发者_如何学C(thai string- ทฟืรห้ททฟืรห้ท) into .mdb file , but when i look into database it converts to like
ทฟืรห้ท&
, how can i store exact thai string into access database , please help.
The first thing you need to do is completely separate the JSP side from the Access side.
There may well be problems on both sides - but trying to diagnose them at the same time is going to be hopeless.
Write a console application to read and write from the database. Don't just try printing the strings to the console: write out the Unicode character values as integers, and look them up on the Unicode charts pages.
Give your JSP a different data source: one with hard-coded data to read, and logging (again, of Unicode code point values as integers) when writing. That way you can tell whether you can display data appropriately and what happens when the user enters data.
See this article for a little more detail - it's C#-based, but the principles apply to Java and JSP.
may be you are facing this problem cause of Localization and Globalization concept, try to add or activate that particular language in your browser.
Regards, Vishal
精彩评论