title: Assign [array of byte] to a Variant with no Unicode conversion
body: <p>Consider the following code snippet (in Delphi XE2):</p>
  
  <pre><code>function PrepData(StrVal: string; Base64Val: AnsiString): OleVariant;
  begin
    Result := VarArrayCreate([0, 1], varVariant);
    Result[0] := StrVal;
    Result[1] := Base64Val;
  end;
  </code></pre>
  
  <p><code>Base64Val</code> is a binary value encoded as Base64 (so no <code>null</code> bytes).  The (<code>OleVariant</code>) <strong>Result</strong> is automatically marshalled and sent between a client app and a DataSnap server.</p>
  
  <p>When I capture the traffic with Wireshark, I see that both <code>StrVal</code> and <code>Base64Val</code> are transferred as Unicode strings.  If I can, I would like to avoid the Unicode conversion for <code>Base64Val</code>.  I've looked at all the <code>Variant</code> types and don't see anything other than <code>varString</code> that can transfer an array of characters.</p>
  
  <p>I found <a href="https://stackoverflow.com/a/13144162/822072">this question</a> that shows how to create a variant array of bytes.  I'm thinking that I could use this technique instead of using an <code>AnsiString</code>.  I'm curious though, is there another way to assign an array of non-Unicode character data to a Variant without a conversion to a Unicode string?</p>