Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(MFC) UU Encoding and DecodingDemonstrates how to UU encode and decode.
#include <CkCrypt2.h> void ChilkatSample(void) { CkString strOut; // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. CkCrypt2 crypt; const char *s1 = 0; const char *s2 = 0; const char *s3 = 0; s1 = "This string is to be UU encoded"; crypt.put_UuMode("666"); crypt.put_UuFilename("something.txt"); // UU encode: s2 = crypt.encodeString(s1,"ansi","uu"); // Note: Call crypt.Encode instead of crypt.EncodeString // to UU encode binary bytes (i.e. non-text binary data). strOut.append(s2); strOut.append("\r\n"); // UU decode: CkCrypt2 crypt2; s3 = crypt2.decodeString(s2,"ansi","uu"); // Note: Likewise, call crypt.Decode to decode non-text binary data. strOut.append(s3); strOut.append("\r\n"); // Show the file permissions mode and filename found // in the UU encoded data: strOut.append("UuMode = "); strOut.append(crypt2.uuMode()); strOut.append("\r\n"); strOut.append("UuFilename = "); strOut.append(crypt2.uuFilename()); strOut.append("\r\n"); SetDlgItemText(IDC_EDIT1,strOut.getUnicode()); } |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.