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
(PureBasic) UU Encoding and DecodingDemonstrates how to UU encode and decode.
IncludeFile "CkCrypt2.pb" Procedure ChilkatExample() ; This example assumes the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. crypt.i = CkCrypt2::ckCreate() If crypt.i = 0 Debug "Failed to create object." ProcedureReturn EndIf s1.s s2.s s3.s s1 = "This string is to be UU encoded" CkCrypt2::setCkUuMode(crypt, "666") CkCrypt2::setCkUuFilename(crypt, "something.txt") ; UU encode: s2 = CkCrypt2::ckEncodeString(crypt,s1,"ansi","uu") ; Note: Call crypt.Encode instead of crypt.EncodeString ; to UU encode binary bytes (i.e. non-text binary data). Debug s2 ; UU decode: crypt2.i = CkCrypt2::ckCreate() If crypt2.i = 0 Debug "Failed to create object." ProcedureReturn EndIf s3 = CkCrypt2::ckDecodeString(crypt2,s2,"ansi","uu") ; Note: Likewise, call crypt.Decode to decode non-text binary data. Debug s3 ; Show the file permissions mode and filename found ; in the UU encoded data: Debug "UuMode = " + CkCrypt2::ckUuMode(crypt2) Debug "UuFilename = " + CkCrypt2::ckUuFilename(crypt2) CkCrypt2::ckDispose(crypt) CkCrypt2::ckDispose(crypt2) ProcedureReturn EndProcedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.