Link to home
Start Free TrialLog in
Avatar of rianto
rianto

asked on

Displaying in Thai or Chinese characthers

Hi,

Anybody knows how to display characters in Thai or Chinese from MS SQL 2000 using Java or JSP?

Please advise, Thanks.


Regards,
Rianto
Avatar of girionis
girionis
Flag of Greece image

Set the encoding of the JSP to UTF-8 this should work. If not check a few things

1) Are the characters saved correctly in the database (can you see chinese/thai from the database at all)?
2) In what encoding are they saved?
3) What do you see in the JSP page?
And do you have the correct fonts installed to be able to see that chars in the first place?
that = the :-/
As Tim says, you need the correct fonts on your machine. (Or at leat the target machine).
Batang should handle both of these I think.
Avatar of rianto
rianto

ASKER

Thanks for the reply.

Yes, I've set the regional setting to Thai, I can see Thai in my XP machine.
When I manually inputted the Thai characters into DB through SQL enterprise manager, I can see the Thai characters and display out correctly in JSP.
Problem arise when I add the Thai characters from the JSP into MS SQL.
Sorry for not being detailed and clear enough.

Girionis, regarding the question:
1. In Database, Encoding: THAI_CI_AS.
    If I input manually into DB, it can display Thai correctly.
    If I input from JSP into DB, it display ??????????????? (even in the DB itself).
2. I've put <%@ page pageEncoding="UTF-8" %> on top of the JSP page.
    Do I need to add in this line?
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
3. "???????????????" for the input from JSP into DB.
1) What is the encoding of the JSP page when you input the characters into the db?

2) No
Avatar of rianto

ASKER

Instead of putting <%@ page pageEncoding="UTF-8" %> on top of every page, I've put the following codes on top of every page:

"<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
</head>"

It works now both retrieving and output, But why does it store funny characters like "&#3609;&#3585;&#3634;" into the Database?
Anyway around it?


These are characters that cannot be represented properly in the database's encoding.
ASKER CERTIFIED SOLUTION
Avatar of girionis
girionis
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rianto

ASKER

Thanks for the answer girionis, now it provides me greater understanding.
But I still can't insert the right Thai characters inside the DB, it shows wrong characters even in Tomcat System.out.println before being inserted into the DB.

I'm really grateful with your help.
To be fair, I'm accepting the answer as I didn't mention the newly found problems in the question.
I've posted another question regarding how to insert the Thai characters correctly inside MS SQL DB under username: "rospcc", and give 500 points.
Please assist me on that thread..Thanks.
Ok I will have a look and do my best. Thank you for accepting :)
Avatar of rianto

ASKER

Hi Venabili,

the other one is my boss' account, not mine.
I'm just borrowing from her for a while.
>I'm just borrowing from her for a while.
Which means that you use two account at the same time (for not paying for points for example) Which is also a violation...
Avatar of rianto

ASKER

I'm not a paid subscriber, but my boss is. I'm not interested in getting the free points or whatsoever.
I'm using his account for convenience sake.
If you don't allow me to have my account, but to only can represent my boss to post his questions, or just he himself can post questions without delegating to me, then please terminate my account to solve all headache.
Thanks.