Reputation: 1
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 becomes 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.
Upvotes: 0
Views: 292
Reputation: 52518
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?
Upvotes: 1
Reputation: 9847
Try to set connection data collation to unicode_ci or more specidfied.
Upvotes: 0