(AutoIt) UU Encoding and Decoding
Demonstrates how to UU encode and decode.
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oCrypt = ObjCreate("Chilkat.Crypt2")
Local $s1
Local $s2
Local $s3
$s1 = "This string is to be UU encoded"
$oCrypt.UuMode = "666"
$oCrypt.UuFilename = "something.txt"
; UU encode:
$s2 = $oCrypt.EncodeString($s1,"ansi","uu")
; Note: Call crypt.Encode instead of crypt.EncodeString
; to UU encode binary bytes (i.e. non-text binary data).
ConsoleWrite($s2 & @CRLF)
; UU decode:
$oCrypt2 = ObjCreate("Chilkat.Crypt2")
$s3 = $oCrypt2.DecodeString($s2,"ansi","uu")
; Note: Likewise, call crypt.Decode to decode non-text binary data.
ConsoleWrite($s3 & @CRLF)
; Show the file permissions mode and filename found
; in the UU encoded data:
ConsoleWrite("UuMode = " & $oCrypt2.UuMode & @CRLF)
ConsoleWrite("UuFilename = " & $oCrypt2.UuFilename & @CRLF)
|