Skip to content

Instantly share code, notes, and snippets.

@arman-hpp
Created April 24, 2023 06:57
Show Gist options
  • Save arman-hpp/20b20926dbc0620c60ef22492011e59b to your computer and use it in GitHub Desktop.
Save arman-hpp/20b20926dbc0620c60ef22492011e59b to your computer and use it in GitHub Desktop.
Delphi Parse Json
DecodeJsonUnicodeBytes(const unicodeByteStr: String): String;
var
LJSONObject: TJSONValue;
begin
try
LJSONObject := TJSONObject.ParseJSONValue(TEncoding.UTF8.GetBytes('{"alias":"'+unicodeByteStr+'"}'), 0, true);
Result := LJSONObject.GetValue<String>('alias');
finally
LJSONObject.Free;
end;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment