title: vb.net encoding.unicode.getbytes issue
body: <p>I'm trying to export data from an SQL Server database to a csv file in a zipped folder using vb.net (framework version 3.5) for transmission to other users. All works fine except when the data in a field contains the euro symbol or when it's been pasted into a text field from a web page - then the output csv seems to contain null characters that throw off the csv parsers (including Excel's) resulting in line breaks that shouldn't be there (I've enclosed any fields with multiple lines in double quotes).</p>
  
  <p>I've traced it down to certain characters in the text that seem to upset Encoding.Unicode.GetBytes - it replaces them with a null character. If I use Encoding.Default.GetBytes that works OK, but then I run the risk of the sender and receiver using different code pages and the possibility that the receiver won't be able to import the data.</p>
  
  <p>As I mentioned, one of the problem characters is the euro symbol (chr(128)), others include chr(130 to 140) and chr(145 to 156).</p>
  
  <p>So what I have at the moment is:</p>
  
  <pre><code> Dim b() As Byte = Text.Encoding.Default.GetBytes(itm.ItemText)
  
   pkgpart.GetStream().Write(b, 0, b.Length)
  </code></pre>
  
  <p>which works, but the preferred:</p>
  
  <pre><code> Dim b() As Byte = Text.Encoding.Unicode.GetBytes(itm.ItemText)
  
   pkgpart.GetStream().Write(b, 0, b.Length)
  </code></pre>
  
  <p>doesn't.</p>
  
  <p>Can anyone tell me what I'm missing in order to get the Unicode.Getbytes method to work?</p>
  
  <p>Any help would be appreciated.</p>