View Single Post
  #1 (permalink)  
Old June 30th, 2009, 08:40 AM
i_shahid i_shahid is offline
Authorized User
Points: 71, Level: 1
Points: 71, Level: 1 Points: 71, Level: 1 Points: 71, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Islamabad, Punjab, Pakistan.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Converting ASCII Text file to Unicode

Hi,
The problem i am having is that i have to process CSV files into the database. My CSV files are in ASCII format as provided by customer. These files can contain german characters so therefor i need to save these in unicode format so that i can read them and update in SQLServer.
Currently what i do is that i open the CSV file and save it in Unicode format manually and all processing is done alright. What i have to do is to write an application which will process these files automatically. So want the saving to be done by the application.
I am using C#.Net as my programming language.
I have searched the web and different forums for this. The solution that most of the forums have provided is to use StreamReader and StreamWriter classes and use Encoding.unicode or Encoding.UTF-8. The file is saved alright but german characters are still not been converted to unicode.
I have tried almost all ways i found on internet for this purpose to try saving file in unicode but havent succeeded yet.
Will any body tell me that what mistake i am making that german characters are not been converted to unicode.
Thanks
Reply With Quote