Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to insert Thai language


How to insert Thai language

Author
Message
charan-703265
charan-703265
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 30
Hi,

I need to insert Thai fonts thru insert SQL statement from query analyzer or thru ASP coding. If i insert, i see only junk characters (like ?????). If I copy and paste in to table from Enterprise manager i am able to see the Thai text clearly. Why this happens? any idea? How to solve this problem. anybody pls reply asap.

Thanks in advance
Gift Peddie
Gift Peddie
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3464 Visits: 14456
Thai is one of the right to left languages as Arabic so you need to define the column or table or database with Thai collation and Nvarchar/Nchar/Ntext data type.


http://msdn.microsoft.com/en-us/library/aa258233(SQL.80).aspx

http://msdn.microsoft.com/en-us/library/aa176553(SQL.80).aspx

Kind regards,
Gift Peddie
moes-1066295
moes-1066295
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 5
Hi,

I have written some pages in asp.net and i use adodb to enter into a MSSQL 2000 database.
I made a form and i can enter thai characters in it.

I use to following to enable thai characters

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.Charset = "tis-620"
End Sub

Now I enter thai into a textfield (แฟพ is my text and the form field is named xlate) and i do a request.form and I get แฟพ back and i write it on the screen. Happy so far.

Now I use the following to update into the database:

objConn.Execute("Update tl_translate Set tl_th = '" & Request.Form("xlate") & "' Where tl_id = " & Request("tl_id"))

I get a ? in the database and when i write the database value on the screen (webpage) i get a ? too.

I made the field in the database a nvarchar and use Thai_CI_AS collation.....

If someone can tell me where i go wrong..I will give him/here a cookie :-)
moes-1066295
moes-1066295
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 5
This seems to work....

objConn.Execute("Update tl_translate Set tl_th = N'" & Request.Form("xlate") & "' Where tl_id = " & Request("tl_id"))

I'll eat the cookie myself Smile
pavel0444i
pavel0444i
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 4
It is a critical thing to insert thai language. It has similarity as arabic language.

Buy Magic Jack
moes-1066295
moes-1066295
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 5
What I find funny/wierd/stupid....

There are two ways to make thai characters available on a webpage:

1) Set the charset (code behind)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.Charset = "tis-620"
End Sub

2) In the meta tag (html)
meta http-equiv="Content-Type" content="text/html; charset=windows-874">

This should do the same, AFAIK, but it seems it dont. When i do 1) and make a form and submit that form, the characters get messed up. When I do 2) all works well.

So you really need to do 2) and then use the right collation and insert statement to insert into you database. I think that it is funny/wierd/stupid that there is difference between 1) and 2)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search