Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert to Unicode in ASP 1

Status
Not open for further replies.

msoul

Programmer
Jan 12, 2007
4
US
Hi,

I need to convert a string to Unicode and store it in Sql server 2000. And retrieve it from the database and display it on the screen.

How do I convert a string or text to unicode in ASP?
And do i make any changes to field datatype to store the unicode?

Thanks in advance...
 
Create your tables with datatype nchar instead of char and nvarchar instead of varchar and you should be fine.
 
I really appreciate your reply. What would happen if i leave the database in varchar instead of nvarchar because i need the size 5000 for that field and nvarchar accepts only 4000.

Anything on converting to Unicode in ASP?

Thanks
 
Right, because unicode uses 2 bytes per character.

You could use the ntext data type if nvarchar is too small but you should ask yourself why you want unicode at all?

Are you storing some text that is not in English? Do you have some Chinese or other language that required an extended characterset?
 
We needed to store characters other than english too, that is the reason I was planning to use Unicode to store the data.

Thanks
 
how do I convert to Unicode in asp?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top