开发者

How to output unicode?

Hey guys, I need to export data from database which contains Unicode(like Japanese characters). While when i trying to export to csv files, it just be开发者_高级运维comes the garbage....

First, I need to read data from database and save it to an datatable Second, I will make a query based on the datatable (Using Linq) Last, Export the queried results to csv file

Is there any way to solve this problem?

Thanks a lot.


Internally .Net (C#) always uses unicode. The problems occur when you export the data. Then you need to specify an encoding.

If you use File.CreateText you immediatly create a UTF-8 encoded file.

Does the application you use for import, recognize the UTF-8 encoding, or does it need a specific encoding?


Try to set connection data collation to unicode_ci or more specidfied.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜