Archived Forum Post

Index of archived forum posts

Question:

Escaping JSON strings

Jan 05 '17 at 16:20

I looked over the character and binary encoding lists but couldn't find one that could help me with escaping JSON strings.

I'm looking for a way to escape strings when using CkJsonObject.AppendString so that the output contains only ASCII characters.

Is there any way to escape strings according to the JSON RFC 4627 so that you could then use them as input to CkJsonObject appendString?


Answer

I added the "json" encoding for escaping and unescaping JSON strings. This is in v9.5.0.66 and later (not yet released). I can provide a pre-release..

Android: JSON Escape and Unescape a String

Classic ASP: JSON Escape and Unescape a String

C: JSON Escape and Unescape a String

C++: JSON Escape and Unescape a String

C#: JSON Escape and Unescape a String

C# UWP/WinRT: JSON Escape and Unescape a String

DataFlex: JSON Escape and Unescape a String

Delphi ActiveX: JSON Escape and Unescape a String

Delphi DLL: JSON Escape and Unescape a String

.NET Core C#: JSON Escape and Unescape a String

Excel: JSON Escape and Unescape a String

Visual FoxPro: JSON Escape and Unescape a String

Java: JSON Escape and Unescape a String

Lianja: JSON Escape and Unescape a String

MFC: JSON Escape and Unescape a String

Mono C#: JSON Escape and Unescape a String

Node.js: JSON Escape and Unescape a String

Objective-C: JSON Escape and Unescape a String

Perl: JSON Escape and Unescape a String

PHP ActiveX: JSON Escape and Unescape a String

PHP Extension: JSON Escape and Unescape a String

PowerBuilder: JSON Escape and Unescape a String

PowerShell: JSON Escape and Unescape a String

PureBasic: JSON Escape and Unescape a String

Python: JSON Escape and Unescape a String

Ruby: JSON Escape and Unescape a String

SQL Server: JSON Escape and Unescape a String

Swift: JSON Escape and Unescape a String

Tcl: JSON Escape and Unescape a String

Unicode C: JSON Escape and Unescape a String

Unicode C++: JSON Escape and Unescape a String

Visual Basic 6.0: JSON Escape and Unescape a String

VB.NET: JSON Escape and Unescape a String

VB.NET UWP/WinRT: JSON Escape and Unescape a String

VBScript: JSON Escape and Unescape a String

Xojo Plugin: JSON Escape and Unescape a String