When serializing and deserializing Strings stored in "
asText" (isType =
rtc_Text) to and from
XML-RPC (to/fromXMLRPC methods) as well as
RTC (to/fromCode methods) formats,
UTF-8 Encoding and Decoding will be used internally by
TRtcValue objects serialization and deserialization methods.
But ... this does
NOT apply to
JSON and JSON-RPC, since JSON has its own format for storing Strings, which is described in the
JSON standard (
ECMA 404 - "String" on Page 4 - see link below).
TRtcValue objects use the
JSON standard for "escaping" Unicode Strings (as described in ECMA 404) when serializing "asText" (isType = rtc_Text) to JSON, and follow the same rules when deserializing JSON back into TRtcValue objects. There is no other Encoding or Decoding performed on Strings by TRtcValue objects when using JSON:
http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf In a nutshell, if you use JSON or JSON-RPC, there is no need to specify "encoding" for Strings, becuause it is already specified by the JSON standard (unless you add your own Encoding on top of that standard).
If you want to see the exact implementation used for "encoding" and "decoding" Strings to and from JSON when using "asText" with TRtcValue objects, check the "
JSON_EncodeString" and "
JSON_DecodeString" functions from the "
rtcInfo.pas" unit ("Lib" folder in the RealThinClient SDK).
Best Regards,
Danijel Tkalcec