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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 store multi lingual

Author  Topic 

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2004-03-31 : 02:04:21


Hi

i have a ASP application we add multi lingual support to it.
it works fine. but we found a problem with database..


Language charaters entered length in database
japanese 2 4
chinese 2 10
arabic 1 4

why is so....

i cannot change the database nor the application
what can be the best solution



======================================
Ask to your self before u ask someone

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2004-03-31 : 04:00:18
khalik, I don't understand what you are trying to point out here. What do you mean by characters entered VS length in database? Are you saying that if you enter 2 japanese characters it takes up 4 bytes of space? Or that LEN(expression) returns 4 instead of 2?

A little clarification would help.

OS
Go to Top of Page

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2004-03-31 : 04:46:41
now this may sound bit clear...
when we enter one charater in jap . and when we check the len() in database it returns 2... where as english its will be 1
enterd charater “ú which is one charater in jap and in eng “ ú

======================================
Ask to your self before u ask someone
Go to Top of Page

suwei
Starting Member

10 Posts

Posted - 2004-03-31 : 04:56:29
in the computer the length of japanese charater is 2 ,while the english(ascii) is
1
Go to Top of Page

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2004-03-31 : 05:37:37
very well but in this case how will we handle ..... changing the app will cost a lot .. and if i change the database ...? what can be changed and where and how will it effect....

======================================
Ask to your self before u ask someone
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-31 : 16:49:02
What is the current data type of that column?

Tara
Go to Top of Page

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2004-04-12 : 04:11:56
nVarchar....................

======================================
Ask to your self before u ask someone
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2004-04-12 : 07:00:24
I have read in BOL a while back that nvarchar-datatype is unicode and uses 2 bytes for each character regardless of the language, but latin/ascii-characters only need 1 byte so maybe it just reserves two bytes instead of one even though it is not beeing used. When you talk about the LEN()-function it must be returning the actual bytes used in the string and not the bytes reserved which realy makes more sense. If this was not the case then a LEN() on a char(20)-field would always return 20 and this would not be desireable.

--
Lumbago
"Real programmers don't document, if it was hard to write it should be hard to understand"
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-04-12 : 08:03:26
I believe your database will need to be kana-sensitive to properly handle Japanese characters as one character Khalik. Sorry I didn't read this earlier.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page
   

- Advertisement -