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
Anybody knows how to display characters in Thai or Chinese from MS SQL 2000 using Java or JSP?
Please advise, Thanks.
Regards,
Rianto
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.
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.
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
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
2) No
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 "นกา" into the Database?
Anyway around it?
"<head>
<meta http-equiv="Content-Type" content="text/html;charset
</head>"
It works now both retrieving and output, But why does it store funny characters like "นกา" into the Database?
Anyway around it?
These are characters that cannot be represented properly in the database's encoding.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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 :)
ASKER
Hi Venabili,
the other one is my boss' account, not mine.
I'm just borrowing from her for a while.
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...
Which means that you use two account at the same time (for not paying for points for example) Which is also a violation...
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.
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.
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?