Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 559
  • Last Modified:

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
0
rianto
Asked:
rianto
  • 5
  • 5
  • 2
  • +2
1 Solution
 
girionisCommented:
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?
0
 
TimYatesCommented:
And do you have the correct fonts installed to be able to see that chars in the first place?
0
 
TimYatesCommented:
that = the :-/
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
krakatoaCommented:
As Tim says, you need the correct fonts on your machine. (Or at leat the target machine).
0
 
krakatoaCommented:
Batang should handle both of these I think.
0
 
riantoAuthor Commented:
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.
0
 
girionisCommented:
1) What is the encoding of the JSP page when you input the characters into the db?

2) No
0
 
riantoAuthor Commented:
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?


0
 
girionisCommented:
These are characters that cannot be represented properly in the database's encoding.
0
 
girionisCommented:
> Anyway around it?

Check the db encoding and the encoding of the jsp that writes into the database. They should be the same.
0
 
riantoAuthor Commented:
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.
0
 
girionisCommented:
Ok I will have a look and do my best. Thank you for accepting :)
0
 
riantoAuthor Commented:
Hi Venabili,

the other one is my boss' account, not mine.
I'm just borrowing from her for a while.
0
 
VenabiliCommented:
>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...
0
 
riantoAuthor Commented:
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.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 5
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now