Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(C) ZATCA Decode QR CodeSee more ZATCA ExamplesDecodes a base64 ZATCA QR code. Note: This example requires Chilkat v9.5.0.92 or greater.
#include <C_CkBinData.h> void ChilkatSample(void) { const char *qr; HCkBinData bd; BOOL success; int index; int expectedTag; int tag; int len; const char *tagValue; // Note: This example requires Chilkat v9.5.0.92 or greater. qr = "ARdBaG1lZCBNb2hhbWVkIEFMIEFobWFkeQIPMzAwMDc1NTg4NzAwMDAzAxQyMDIyLTAzLTEzVDE0OjQwOjQwWgQHMTEwOC45MAUFMTQ0LjkGLCtiQTFtdWNWSTY3SDRXQ2JOL2U5SjJxVXBIVHQzVHdNZHhsa09XVGVvdjg9B2BNRVlDSVFDWWg1ZTNpcklxV2w1WXRhQ25LaXVqTUlUbW9rWFlPUE1wSURDSW9XVzc5d0loQU1YbWMrTUZIR3RhZUJzZU91RUdUbHdENmcwOWdOUVBSUHVZODlzNjVPV1MIWDBWMBAGByqGSM49AgEGBSuBBAAKA0IABNMAr2WtNWSj2uSrplhxz0cNFk/hv1LjMDgqbthcn6ydNWEuTNTQeyZJf1SfyMOFFM4cMpp+3wL+65Rj3fi+4w0JSDBGAiEAlcAzHKujzvjHJrAV1M/79RnYRqe66kmtgMUykr/N/CACIQDgTQwbfftw0pYo6FX8c63Q4edvFgt+7JhHaBlla0qRtQ=="; qr = "AQxGaXJveiBBc2hyYWYCCjEyMzQ1Njc4OTEDEzIwMjEtMTEtMTcgMDg6MzA6MDAEBjEwMC4wMAUFMTUuMDAGLDlmc3JYVW8rU3BYQVlJTkw5aGFLU2dEOXgxaVJsZk53SVBDZnBlWXczYTA9B1hYMEM4VjFIL3hUMGdOaytWWXh2U2Z6UFJlUjZPM2t5VXA0TERITzJLMzlNSGJETXVvTGltQSt3RnovV2pVdEdMSHpaK0J5enNmWUdEQzliNUFGSU1FQT09CFgwVjAQBgcqhkjOPQIBBgUrgQQACgNCAARw3B+mu14x0h3pJFKqEWWT7DmD7jWYkZV7qHyikPlN4P/4/b7YD+A9wnFI92HTKm+/BGKXVf/pfLtsmdIIaPHnCUgwRgIhAMTjOkWwcNu5Aw5k1Yr3YgbPhdxKoJV1a3+5ShPtx1/IAiEAyrwsA/NuqV6XjybyrZpMp6eJAqslACLfCldti/PVOQs="; bd = CkBinData_Create(); success = CkBinData_AppendEncoded(bd,qr,"base64"); index = 0; expectedTag = 1; while ((expectedTag <= 9)) { // Get the tag tag = CkBinData_GetByte(bd,index); if (tag != expectedTag) { printf("Expected tag %d\n",expectedTag); CkBinData_Dispose(bd); return; } index = index + 1; len = CkBinData_GetByte(bd,index); if (len == 0) { printf("Expected length > 0\n"); CkBinData_Dispose(bd); return; } index = index + 1; // Tags 8 and 9 contain binary data. if (expectedTag >= 8) { tagValue = CkBinData_getEncodedChunk(bd,index,len,"base64"); } else { tagValue = CkBinData_getTextChunk(bd,index,len,"utf-8"); } printf("tag %d: %s\n",tag,tagValue); index = index + len; expectedTag = expectedTag + 1; } CkBinData_Dispose(bd); } |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.