SQL and Chinese Characters

Aleks
Aleks used Ask the Experts™
on
I have a classic ASP web application with MS SQL 2008 back end.
98% of my users use the regular keyboard, but there are a few that have a Chinese keyboard.

When they type in and save a field it shows weird characters after saving.
What needs to be done so that they save correctly ?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Web Ninja at large
Commented:
make sure you're using UTF-8 when saving your data, have a read of this article for more understanding

http://blog.inspired.no/utf-8-with-asp-71/
Shaun KlineLead Software Engineer

Commented:
One other item to be concerned with is that you are using nchar/nvarchar when saving data as these SQL data types can handle the double byte character set that the Chinese language uses. You may also need to adjust the language type for the columns in your SQL data tables as this can also cause issues when saving data. Start with Big Monty's suggestion first, though.
Vitor MontalvãoIT Engineer
Distinguished Expert 2017

Commented:
What's the collation set for the SQL Server instance and the database?
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

Author

Commented:
it is:  SQL_Latin1_General_CP1_CI_AS

Most users will enter information in English or Spanish, but we want to allow Chinese characters as well.
Is this possible without causing any issues to existing data and new data entered in Spanish or English ?
Vitor MontalvãoIT Engineer
Distinguished Expert 2017
Commented:
The only way to store Chinese characters is to use a Chinese collation.
You can add a Chinese collation column to the table so when it's Chinese character you store the value into this column otherwise in the current one.

Author

Commented:
That is a whole lot of work, its basically having to duplicate the database. :#
any other ideas ?
Big MontyWeb Ninja at large
Commented:
The only way to store Chinese characters is to use a Chinese collation.

I don't believe that's true, as you just need to save the data in unicode format. I know this because I just checked my database and it only has SQL_Latin1_General_CP1_CI_AS collation on the table I store the data in.

Aleks - did you have a look at the article I posted? Did you try setting the headers? If so, what happened? Maybe you could post some example code?
Vitor MontalvãoIT Engineer
Distinguished Expert 2017
Commented:
A Unicode database is also a good solution but now it will give some work to migrate the current non-Unicode database to an Unicode one.
Vitor MontalvãoIT Engineer
Distinguished Expert 2017
Commented:
This question is neglected.
amucinobluedot, do you have any feedback on this?

Author

Commented:
This is not something feasible (migrating data, etc), for now it will remain the same way it is. Thanks for the help.

Author

Commented:
I had to put this on hold but the two solutions may work. I won't implement until later this year, sorry.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial