REST.Json.TJson.JsonEncode

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class function JsonEncode(AJsonValue: TJSONValue): string; overload;
class function JsonEncode(const AJsonString: String): string; overload;

C++

__classmethod System::UnicodeString __fastcall JsonEncode(System::Json::TJSONValue* AJsonValue)/* overload */;
__classmethod System::UnicodeString __fastcall JsonEncode(const System::UnicodeString AJsonString)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
REST.Json.pas
REST.Json.hpp
REST.Json TJson

Description

Given a JSON value object or a JSON string with unescaped characters that must be escaped in JSON, JsonEncode returns a valid JSON representation, with all characters that need escaping properly escaped.

For example, given a string such as {"name":"something\else"} JsonEncode returns {"name":"something\\else"}.

See Also