title: How to parse line by line WinHTTP response: UTF-8 encoded CSV?
body: <p>As the next step for my happily solved problem (<a href="https://stackoverflow.com/questions/14184926/not-understanding-why-winhttp-does-not-authenticate-certain-https-resource">Not understanding why WinHTTP does NOT authenticate certain HTTPS resource</a>) I need to prettily parse obtained CSV. At the moment I use the following solution:</p>
  
  <pre><code>If HTTPReq.Status = 200 Then
      If FSO.FileExists(CSV_Path) = True Then FSO.DeleteFile (CSV_Path)
      Set FileStream = CreateObject("ADODB.Stream")
      FileStream.Open
      FileStream.Type = 1
      FileStream.Write HTTPReq.responseBody
      FileStream.SaveToFile (CSV_Path)
      FileStream.Close
      ActiveWorkbook.Connections("Redmine Timelog").Refresh
      ActiveSheet.PivotTables("PivotTable_RM").PivotCache.Refresh
  End If
  </code></pre>
  
  <p>That is, I save CSV to disk and then link it as data source to Excel. However, I'd like to have my Excel book self-sufficient, with no need to create additional files (for some quite obvious reasons).</p>
  
  <p>The solution is pretty simple in my case: store <code>WinHTTP.responseText</code> line by line on the separate Excel sheet (instead of currently stored linked CSV) and then use <code>Text to Data</code> Excel conversion. However, I face the following immediate troubles:</p>
  
  <ol>
  <li>CSV is UTF-8 encoded, while raw WinHTTP response text seems to be NOT. Is there any way to interpret it using desired encoding?</li>
  <li>How to split CSV into lines? Use <code>Split</code> function or whatever else? CSV seems to use some of standard NewLine chars, and the data 99% should have NOT any of these.</li>
  </ol>
  
  <p>There are many similar troubles solved, but I found nothing clear and acceptable for VBA so far, so any help will be appreciated. Thanks in advance!</p>