Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicPythonRubySQL ServerSwiftTclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcel

Excel Examples


ASN.1
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Azure Cloud Storage
Azure Service Bus
Bounced Email
Box
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Email Object
Encryption
FTP
Facebook
Firebase
GeoOp
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
Gzip
HTML-to-XML/Text
HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)

Jira
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
PayPal
Peoplevox
QuickBooks
REST
REST Misc
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Shopify
Socket/SSL/TLS
Spider
Stream
Stripe
SugarCRM
Tar Archive
Twitter
VoiceBase
Walmart
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Xero
Zip
curl
eBay

 

 

 

(Excel) JSON Escape and Unescape a String

The encoding mode keyword "json" was added in Chilkat v9.5.0.66 to provide the ability to escape and unescape JSON strings. See Chilkat Encodings for the full list of encoding keywords, such as "base64", "hex", "url", etc.

Download Excel Class Modules

Chilkat Excel Class Modules

'  Note: This example requires Chilkat version 9.5.0.66 or greater.

Dim sb As Chilkat.StringBuilder
Set sb = Chilkat.NewStringBuilder

Dim success As Boolean
success = sb.Append("backslash: \\\\, A: \\u0041")
Debug.Print sb.GetAsString()

'  The output is:
'     backslash: \\, A: \u0041

'  Starting in Chilkat v9.5.0.66, the keyword "json" can be used
'  to escape and unescape.  To escape is to encode.  To unescape is to decode.

'  Unescape (decode) the string in sb.
success = sb.Decode("json","utf-8")
Debug.Print sb.GetAsString()

'  After JSON unescaping:
'     backslash: \, A: A

'  Now JSON escape the string.
success = sb.Encode("json","utf-8")
Debug.Print sb.GetAsString()

'  After JSON escaping:
'     backslash: \\, A: A

'  Note: The "A" is not escaped to "\u0041" because there is no need.
'  The "\uXXXX" format would be produced for non-printable control chars.

 

© 2000-2016 Chilkat Software, Inc. All Rights Reserved.