title: Delphi XE - RawByteString vs AnsiString
body: <p>I had a similar question to this here: <a href="https://stackoverflow.com/questions/6049582/delphi-xe-should-i-use-string-or-ansistring">Delphi XE - should I use String or AnsiString?</a> . After deciding that it is right to use ANSI strings in a (large) library of mine, I have realized that I can actually use RawByteString instead of ANSI. Because I mix UNICODE strings with ANSI strings, my code now has quite few places where it does conversions between them. However, it looks like if I use RawByteString I get rid of those conversions.</p>
  
  <p>Please let me know your opinion about it.<br>
  Thanks.</p>
  
  <hr>
  
  <p>Update:<br>
  This seems to be disappointing. It looks like the compiler still makes a conversion from RawByteString to string.</p>
  
  <pre><code>procedure TForm1.FormCreate(Sender: TObject);
  var x1, x2: RawByteString;
      s: string;
  begin
    x1:= 'a';
    x2:= 'b';
    x1:= x1+ x2;
    s:= x1;              {      &lt;------- Implicit string cast from 'RawByteString' to 'string'     }
  end;
  </code></pre>
  
  <p>I think it does some internal workings (such as copying data) and my code will not be much faster and I will still have to add lots of typecasts in my code in order to silence the compiler.</p>