Insert THAI character language into SQL 2000 DB

Hi,

Anybody knows how to insert thai characters correctly into SQL 2000 DB (displayed Thai characters correctly in SQL Enterprise manager)?
Should JSP page encoding set to TIS-620 or UTF-8?
What about the SQL 2000 DB? THAI_CI_AS?

Please advise, Thanks.
rospccAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongCommented:
Your need to use column type of NChar, NVarChar or NText instead, which can handle unicode characters
0
rospccAuthor Commented:
Hi ryan,

It has been set to NVarChar, that's why when I insert manually to SQL Enterprise manager, I can see the Thai characters correctly.
The problem exist when I display out the Thai characters from the DB to the page, it just display unreadable characters.

I think the encoding between JSP page and SQL DB is different, that's why creating such problem.
0
Ryan ChongCommented:
I think it's because your HTML is not encoded properly.. Your JSP header should set to "charset=tis-620" ?

like in HTML, try add:

...
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
...

>>Should JSP page encoding set to TIS-620 or UTF-8?
Yes, definitely. Is this works now?
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

rospccAuthor Commented:
Yes, I've used that, but the database keeps on showing unreadable characters like: &#3585;&#3627;&#3604;&#3585;&#3627;

I'm suspecting it's UTF-8 formatting, because I'm able to display out correctly to JSP page.
If there's no way to change such encodings in DB, Do you have a convertor to convert UTF-8 to the Thai characters?
0
Ryan ChongCommented:
Try checking your row data from database, make sure it's encoded in Thai format?

What if you make a test page, try add the header provided above, then enter some Thai characters there to do testing, is that the Thai characters show correctly there?

>>Do you have a convertor to convert UTF-8 to the Thai characters?
No, i don't speak Thai :)
0
rospccAuthor Commented:
Nope, the characters above were not Thai and those characters are in the DB.

I've made the 2 test pages:
1. Without going through DB
    Managed to input Thai into Textbox and output (out.println) into Thai.
2. Going through DB
    Inputted Thai, but UTF-8 characters (I think) stored into DB, but can display correctly in JSP.
0
nurbekCommented:
try this
while inserting and reading from database
put it top of your page

<%@ LANGUAGE=vbscript  LCID=1054  %>
0
rospccAuthor Commented:
Hi nurbek,

My application is in JSP.
0
nurbekCommented:
try

<%@  LCID=1054  %>
0
rospccAuthor Commented:
It shows me "Invalid directive"
0
nurbekCommented:
hmm

your machine doesnt support thai :)

from regional settings change it (or install) thai

From General selecal "your locale"

and then "language settings for system" check thai language (it may need to restart)

0
rospccAuthor Commented:
My machine supports thai actually.
I can see Thai language in web pages.
0
nurbekCommented:
of course
 you can see different languages in your web page (japanese, english, russian)  if the encoding language is installed

but what i mean is that when you click the time (clock) can you see the weekday names (monthes) in thai?

when you install the thai regional setting then you will be able to see  thai charachters correctly

0
rospccAuthor Commented:
yes. All the months in my system are in Thai.
Could your give me the sample code which have <%@  LCID=1054  %> in JSP? Thanks.
0
nurbekCommented:
try

<%@ LANGUAGE=JScript LCID=1054 %>

if not installed you will get "not available error"

0
Ryan ChongCommented:
>>1. Without going through DB
>>    Managed to input Thai into Textbox and output (out.println) into Thai.
>>2. Going through DB
>>    Inputted Thai, but UTF-8 characters (I think) stored into DB, but can display correctly in JSP.

That's means your data got problem! and when your page adding the encode header, your JSP page was unable to encode it and display correctly on the screen.

So, the problem is on your Data, NOT from your JSP/ Servlet server.
0
Ryan ChongCommented:
>>You can specify a collation of 874 for storing Thai data.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ca-co_5ell.asp

More and tutorial available at http:Q_20869984.html
0
rdcproCommented:
These character references:

&#3585;&#3627;&#3604;&#3585;&#3627;

are the UTF-16M decimal equivalents of:

&#3585;&#3627;&#3604;&#3585;&#3627;

Any "normal" HTML page should be able to correctly interpret these, and it appears you have the correct font glyphs.  Those character references generally get created when the data passes through something that doesn't actually have code points for the characters.  If your DB columns are ntext, nchar, nvarchar then it appears the conversion to character references is either happening when the data is entered, or by something when the data is extracted.  You're saying these character references are actually in the DB, so I'd say that the conversion is happening when data is inserted.  How do you get the data in the DB in the first place?  

Regards,
Mike Sharp
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rospccAuthor Commented:
I've managed to do it.
I built one Unicode Translator.
Anyway, thanks all.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Fonts Typography

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.