Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Unicode is nvarchar, ntext, nchar

Author  Topic 

csphard
Posting Yak Master

113 Posts

Posted - 2008-04-10 : 13:40:50
When I tried to insert armenian by doing the following
insert into tablex (field1) values (N'testdata')
it does not display in query analyzer or in the database as armenian.
When I copy this to word it does not convert it.

What else am I supposed to do to get that information to redisplay the correct way and I would appreciate any tutorials or samples you can show or direct me to.

Howard

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-10 : 14:11:08
SQL Server won't convert it to Armenian. You must submit the data as Armenian. Unicode is just double byte which is required to store unicode type languages. No conversion occurs for you.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

csphard
Posting Yak Master

113 Posts

Posted - 2008-04-10 : 15:12:46
When you say submit it I will copy it paste it into the field or do the following insert into tablex (fieldx) values (N'data')

Now to read it out I do select fieldx from tablex

Now in the browser what do I need so this is displayed as Armenian.

Howard
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-10 : 15:21:56
You have to insert it as Armenian. You can't expect to insert the word 'data' and then SQL Server to translate that word to Armenian. That's not the point of unicode data types. The point of them is to be able to store the languages that require double bytes into double byte data types.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

csphard
Posting Yak Master

113 Posts

Posted - 2008-04-10 : 19:29:18
No I am copying Armenian text that was sent to us. I can see it. So I copy it and paste it and try to insert it. When I paste it into query analzer it no longer looks like armenian text. I insert it thinking that I can read it out. Now when I display it what do i do so that the browser no's what it is.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-10 : 19:50:36
What collation are you using?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

csphard
Posting Yak Master

113 Posts

Posted - 2008-04-10 : 22:28:12
collation has to deal with how it reads right.
meaning some languages are left right and some right to left.


howard

Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-04-10 : 23:31:25
Not only that, different collation uses diferent code page.
Go to Top of Page

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2008-04-11 : 05:11:14
Let's start simple: if you insert a bunch of Armenian characters into a table and select it, does that work?


CREATE TABLE #T ( s nvarchar(100) NOT NULL )

INSERT INTO #T
SELECT NCHAR(1392) + NCHAR(1377) + NCHAR(1397) + NCHAR(1381) + NCHAR(1408) +
NCHAR(1381) + NCHAR(1398) + NCHAR(32) + NCHAR(1388) + NCHAR(1381) +
NCHAR(1382) + NCHAR(1400) + NCHAR(1410)

SELECT * FROM #T

Go to Top of Page

csphard
Posting Yak Master

113 Posts

Posted - 2008-04-11 : 12:16:12
This returns squares:

[][][][][][][] [][][][][]

Howard
Go to Top of Page

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2008-04-11 : 14:07:44
Great, now we're getting somewhere

So the problem here is that what you're displaying the result in -- Query Analyzer or SSMS -- is using a font that doesn't contain any glyphs for Armenian characters. Try changing the output font to one that has.

You can find one by opening the Character Map utility, selecting Unicode Subrange in the Group by field, selecting Armenian in the Group By pop-up window and scrolling through the list of Fonts until you find one that shows some glyphs (unfortunately, it resets the Group by setting when you hit a non-Unicode-encoded font).

Arial Unicode MS certainly has them.
Go to Top of Page

csphard
Posting Yak Master

113 Posts

Posted - 2008-04-11 : 14:55:11
You are right. I have been using sql server but never dealt with different languages. That did work. So I see that

@Arial Unicode MS for CHINESE worked for chinese,greek, togelog, arabic,english)
Masis (Western) for armenian

Now I have to understand how to display this using asp.

Any suggestions. Is that code page?

Thanks for your help

Howard
Go to Top of Page
   

- Advertisement -