|  | 
Chilkat  HOME  Android™  AutoIt  C  C#  C++  Chilkat2-Python  CkPython  Classic ASP  DataFlex  Delphi DLL  Go  Java  Node.js  Objective-C  PHP Extension  Perl  PowerBuilder  PowerShell  PureBasic  Ruby  SQL Server  Swift  Tcl  Unicode C  Unicode C++  VB.NET  VBScript  Visual Basic 6.0  Visual FoxPro  Xojo Plugin
| (Unicode C) JSON Hex EncodingSee more JSON ExamplesLet's say your JSON contains content that is hex encoded like this: \u05d1\u05d3\u05d9\u05e7This example shows how to get the decoded string. 
 #include <C_CkJsonObjectW.h> #include <C_CkStringBuilderW.h> void ChilkatSample(void) { const wchar_t *s; HCkJsonObjectW json; BOOL success; HCkStringBuilderW sb; s = L"{ \"example\": \"\\u05d1\\u05d3\\u05d9\\u05e7\" }"; json = CkJsonObjectW_Create(); success = CkJsonObjectW_Load(json,s); // When getting the member data, it is automatically decoded. wprintf(L"member data: %s\n",CkJsonObjectW_stringOf(json,L"example")); // Output: // member data: בדיק // When getting the full JSON, it remains encoded. This is expected and intentional. wprintf(L"full JSON: %s\n",CkJsonObjectW_emit(json)); // Output: // full JSON: {"example":"\u05d1\u05d3\u05d9\u05e7"} // To get the full JSON without the encoding, you can decode manually. sb = CkStringBuilderW_Create(); CkJsonObjectW_EmitSb(json,sb); // The hex encoding used by JSON is utf-8. CkStringBuilderW_Decode(sb,L"json",L"utf-8"); wprintf(L"%s\n",CkStringBuilderW_getAsString(sb)); // Output: // {"example":"בדיק"} CkJsonObjectW_Dispose(json); CkStringBuilderW_Dispose(sb); } | ||||||
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.