title: Generating CSV file for Excel, how to have a newline inside a value
body: <p>I need to generate a file for Excel, some of the values in this file contain multiple lines.</p>
  
  <p>there's also non-English text in there, so the file has to be Unicode.</p>
  
  <p>The file I'm generating now looks like this: (in UTF8, with non English text mixed in and with a lot of lines)</p>
  
  <pre><code>Header1,Header2,Header3
  Value1,Value2,"Value3 Line1
  Value3 Line2"
  </code></pre>
  
  <p>Note the multi-line value is enclosed in double quotes, with a normal everyday newline in it.</p>
  
  <p>According to what I found on the web this supposed to work, but it doesn't, at least not win Excel 2007 and UTF8 files, Excel treats the 3rd line as the second row of data not as the second line of the first data row.</p>
  
  <p>This has to run on my customer's machines and I have no control over their version of Excel, so I need a solution that will work with Excel 2000 and later.</p>
  
  <p>Thanks</p>
  
  <p>EDIT: I "solved" my problem by having two CSV options, one for Excel (Unicode, tab separated, no newlines in fields) and one for the rest of the world (UTF8, standard CSV).</p>
  
  <p>Not what I was looking for but at least it works (so far)</p>