encode Method

Encode the data.

Syntax

def encode() -> None: ...

Remarks

This method encodes the data according to the format type. The class will encode the data in the input stream if set_input_stream has been set to a valid stream. If this stream is null, the class will then try to read the data from the file set by the decoded_file property. If no valid file has been specified, the class will use the decoded_data property.

The resulting encoded data is written to the output stream if one has been set. If not, the component will attempt to write the encoded data to the encoded_file. If no file was specified, the encoded data may be retrieved through the encoded_data property.

The data is considered binary while uuencoding and Base64 formats, and Text during QuotedPrintable ones.

When uuencoding or yencoding the filename encoded into the data is taken from the file_name property.

The current version of NetCode creates no message headers. If a MIME standard encoding is used such as Base64 Encoding or Quoted Printable Encoding the user should fill the header values appropriately.

If encoded_file and MaxFileSize is set and the encoded data takes more space than MaxFileSize, the data is split over several files. In this case, the user can specify more than one filename by passing them to encoded_file in the form name?. The filenames should exist as path\file0.ext, path\file1.ext ... Question marks "?" are expanded to numerals starting with 0. NetCode appends the extension ".uue", ".b16", or ".q_p" (depending on the value of format) to the filename.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks 2020 Python Edition - Version 20.0 [Build 8307]