Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

DataFlex Examples

Web API Categories

ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
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)
MHT / HTML Email
MIME
MS Storage Providers
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl

 

 

 

(DataFlex) StringBuilder Encode

Demonstrates the Chilkat StringBuilder Encode method.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    String s
    Handle hoSb
    Boolean iSuccess
    String sTemp1

    Move "The quick brown fox jumps over the lazy dog" To s

    Get Create (RefClass(cComChilkatStringBuilder)) To hoSb
    If (Not(IsComObjectCreated(hoSb))) Begin
        Send CreateComObject of hoSb
    End

    Get ComAppend Of hoSb s To iSuccess

    // output: The quick brown fox jumps over the lazy dog
    Get ComGetAsString Of hoSb To sTemp1
    Showln sTemp1

    Get ComEncode Of hoSb "base64" "utf-8" To iSuccess

    // output: VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw==
    Get ComGetAsString Of hoSb To sTemp1
    Showln sTemp1

    Get ComDecode Of hoSb "base64" "utf-8" To iSuccess
    // output: The quick brown fox jumps over the lazy dog
    Get ComGetAsString Of hoSb To sTemp1
    Showln sTemp1

    // Now encode to hex..
    Get ComEncode Of hoSb "hex" "utf-8" To iSuccess
    // output: 54686520717569636B2062726F776E20666F78206A756D7073206F76657220746865206C617A7920646F67
    Get ComGetAsString Of hoSb To sTemp1
    Showln sTemp1

    Get ComDecode Of hoSb "hex" "utf-8" To iSuccess
    // URL encode
    Get ComEncode Of hoSb "url" "utf-8" To iSuccess
    Get ComGetAsString Of hoSb To sTemp1
    Showln sTemp1

    Get ComDecode Of hoSb "url" "utf-8" To iSuccess
    // base64url
    Get ComEncode Of hoSb "base64url" "utf-8" To iSuccess
    Get ComGetAsString Of hoSb To sTemp1
    Showln sTemp1

    // other possible encodings include modbase64, base32, base58, quoted-printable, url_rfc1738, url_rfc2396, url_rfc3986, and fingerprint


End_Procedure

 

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