title: Passing a url encoded byte array
body: <p>I need to pass a byte array via a URL. So I am encoding it with the <code>UrlEncode</code> Method like this:</p>
  
  <pre><code>string ergebnis = HttpUtility.UrlEncode(array);
  </code></pre>
  
  <p>The result is the following string: <code>%00%00%00%00%00%25%b8j</code></p>
  
  <p>Now when I pass this string in a URL like this <code>http://localhost:51980/api/Insects?Version=%00%00%00%00%00%25%b8j</code></p>
  
  <p>This is my <code>Get</code> function:</p>
  
  <pre><code>        public List&lt;TaxonDiagnosis&gt; Get([FromUri] string version)
          {
              List&lt;TaxonDiagnosis&gt; result = new List&lt;TaxonDiagnosis&gt;();
  
              result = db.TaxonDiagnosis.ToList();
  
              byte[] array = HttpUtility.UrlDecodeToBytes(version);
  
              if (version != null)
                  result = db.GetTaxonDiagnosis(array).ToList();
  
              return result;
          }
  </code></pre>
  
  <p>The problem is, <code>version</code>'s value isn't <code>%00%00%00%00%00%25%b8j</code>. Instead it is this <code>\0\0\0\0\0%�j</code>. This of course causes problems when I try to decode it into a <code>byte array</code> again.</p>
  
  <p>How can I pass the correct string in the Url?</p>