Wednesday, March 7, 2012

Displaying Chinese Character in varchar columns

I would like to store some data in Chinese Big5 using a varchar column. However, all the data turn in to some garbage characters like Ru¥Uao? .
I ran into no problem if i use nvarchar but I would like to use varchar because I can only store less than 4000 characters using nvarchar.

It works if I paste the characters directly into the SQL Express Client. It only turns into some garbage characters if i use C++ to insert the data.

I am using Chinese_Taiwan_Stroke_BIN collation (The chinese won't show if I use the default latin collation) on the column and my computer regional setting for non-unicode application is Traditional Chinese(Taiwan).

Any ideas how can I fix this problem? I am suspecting there's a problem with my computer setting?

Thanks!

If you need more than 4000 characters, you should consider using an NText column type. A standard varchar column can only hold characters from its native character set.|||but then ntext insertion and retrival time would be slower and we don't want that

No comments:

Post a Comment