Quantcast
Viewing all articles
Browse latest Browse all 32060

How to write Hindo, Arabic, Chinese, Hebrew Into CSV file?

Hello,

I'm having 2 problems with my function:
1. My major Problem: I cant write to Results.csv any of the languages, I've described in the subject, except English.
each time I'm trying to write any one of them I'm getting %#^% kind of things, in the csv file where it should have Hindo words, for example.

I've been trying to use UTF8Encoding, but i obviously doing something wrong.
please take a look and try to correct me.

2. My minor Problem: My program support's multiple entering for each user, so, I would like to have only one row with his "titlenames", and below it, his "useranswer "(and that's what happening so far, but with multiple "titlenames" row in each entering). moreover, i would like to append his activities to his useranswer in new line, in each new entering. how do i need to correct my code in order to have that?

Here is my Function Code below:


private void WriteToCsvFile()
  {
  var us = users.ElementAt(0);
  string titlenames = "Test Subject no',";
  string userAnswer = (us.userName + ",");
  foreach (string ss in List)
  {
  // Do stuff
  }
  foreach (string ans in us.answer)
  {
  // Do stuff
  }
            using (StreamWriter sw = new StreamWriter("Results.csv"))
            {
                sw.WriteLine(titlenames);
                sw.WriteLine(userAnswer);
            }       
  this.Close();
  }

Thank you for your time and help!

Viewing all articles
Browse latest Browse all 32060

Trending Articles