Support for UTF-8 encoded string in TRestClient Delphi XE10.2 Tokyo

function EncodeAsUTF8(UnicodeStr: string): string;
var
  UTF8Str: UTF8String;
  I: word;
begin
  UTF8Str := UTF8String(UnicodeStr);
  SetLength(Result, Length(UTF8Str));
  for I := 1 to Length(UTF8Str) do
    Result[I] := Char(Ord(UTF8Str[I]));
end;

Comments