title: Error on recording UTF8 string with Datasnap
body: <p>Recently i've migrated from D2007 to 10.3.3 and i'm having the issue below.</p>
  
  <p>I have a TClientDataSet that record data an encrypted string into .cds format, by storing it in a TStringField and using the <em>.saveToFile</em> method. Problem is, the string is not being record correclty into the CDS table.</p>
  
  <p>Here my encrypt function :</p>
  
  <pre><code>function encrypt(const ent: string): string;
  var m, i, k : integer;
  r, s : string;
  begin
  m := 3;
  r := '';
  for I := 1 to Length(ent) do
    begin
    k := ord(ent[i]);
    s := chr(k+m);
    r := r + s;
    inc(m);
    end;
  result := r;
  end;
  </code></pre>
  
  <p>And here is my decrypt function :</p>
  
  <pre><code>function decrypt(const ent: string): string;
  var m, i,j,K : integer;
  r, s : string;
  begin
  m := 3;
  r := '';
  s := ent;
  for I := 1 to length(s) do
    begin
    if ord(s[i]) &lt; 68 then j := 1 else
      j := -1;
    k := ord(s[i]);
    r := r + chr(k-m);
    inc(m);
    end;
  result := r;
  end;
  </code></pre>
  
  <p>Now i want to call this function with the string 'engajamento1234'. 
  Here is how the watch shows the encrypted string  :</p>
  
  <p><a href="https://i.stack.imgur.com/ZQdRT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZQdRT.jpg" alt="enter image description here"></a></p>
  
  <p>And here is how the string is actually inserted into the TStringField column of the table :</p>
  
  <p><a href="https://i.stack.imgur.com/pKJRi.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pKJRi.jpg" alt="enter image description here"></a></p>
  
  <p>Because the string end up being insert incorrectly on the clientdataset, when i call decrypt function with 'hrlgqivoy?|?ACE' string, i get the incorrect original string as 'engajamen3o1234'...</p>
  
  <p>Seems like this problem is related to UTF8 support in the new Delphi version, which the old version did not have. </p>
  
  <p>What i need to do to the string record correctly into the clientdataset and the .cds file, so i get the correct decrypted string back ?</p>