Docs

IPWorks 2022 Python Edition

Version 22.0 [Build 8171]

MIME Class

Properties   Methods   Events   Configuration Settings   Errors  

The MIME class allows for the simple encoding and decoding of MIME structures such as message attachments, file uploads, etc.

Syntax

class ipworks.MIME

Remarks

The class may be used for decoding or encoding of messages. message holds the content of the encoded message or the filename which holds the encoded data. The decoded data is provided in parts properties.

To decode a MIME message you should first assign either the whole message (headers and body) to message or put the message headers into the message_headers property and the message body or the filename holding it into the message property. Calling decode_from_file or decode_from_string directs the class to start parsing the message: it will fill out the content_type, content_type_attr properties with message content type information, and enter information about message parts into the parts properties, which includes: part sizes, part content types, part content type attributes, part content disposition, part content disposition attributes, part encoding, part name, part filename, part headers, or part content (part decoded string or part decoded file) for each decoded part.

Calling the decode_from_string or decode_from_file to decode doesn't actually decode the message but only parses it. The real decoding is done when the part content in the parts properties is first accessed.

To encode data into a MIME message you should first assign values for each part to either part decoded string or part decoded file in the parts properties property, and optionally assign values to the other part attributes in the parts properties. Assigning a value to the part decoded string or part decoded file through the parts properties, fills out automatically the part headers into the parts properties for the respective part. Calling encode_to_file or encode_to_string directs the class to fill out the message with the message body and the message_headers with the headers.

The on_progress event is fired as the message is parsed and the data is decoded/encoded.

Property List


The following is the full list of the properties of the class with short descriptions. Click on the links for further details.

boundaryThe boundary separating the MIME parts. Maximum length of 80 bytes.
content_typeThe value of the content-type header of the message which was encoded/decoded.
content_type_attrThe attributes for content-type header of the message which was encoded/decoded.
messageContains the encoded message text or a path to a file which contains the encoded message text.
message_header_countThe number of records in the MessageHeader arrays.
message_header_fieldThis property contains the name of the HTTP header (same case as it is delivered).
message_header_valueThis property contains the header contents.
message_headers_stringString version of the MIME message headers.
part_countThe number of records in the Part arrays.
part_content_dispositionContent disposition for each part.
part_content_disposition_attrThe content disposition's attribute (if any) for each part.
part_content_idContent identifier for each part.
part_content_typeContent type for each part.
part_content_type_attrThe content type attribute, if any, for each part.
part_decoded_fileThe filename with the decoded data.
part_decoded_stringThis property holds the actual content of each part.
part_encodingThis property contains the actual content encoding type for each part.
part_filenameThis property contains the filename attribute specified in the headers of the part.
part_headersThis property contains the headers for each MIME part.
part_nameThis property contains the name given to a part, such as the filename.
part_sizeThis property contains the size of the DecodedFile or DecodedString .

Method List


The following is the full list of the methods of the class with short descriptions. Click on the links for further details.

configSets or retrieves a configuration setting.
decode_from_fileDecodes from file.
decode_from_stringDecodes from string.
decode_partDecodes the specified part.
decode_part_to_fileDecodes the specified part to a file on disk.
encode_to_fileEncodes to file.
encode_to_stringEncodes to string.
resetReset the class.
reset_dataResets the values of all headers and Part- properties.

Event List


The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.

on_errorInformation about errors during data delivery.
on_headerFired every time a header is parsed.
on_progressShows the progress of decoding/encoding the input data.

Configuration Settings


The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.

DecodeMessageHeadersInstructs the class to automatically decode message headers.
IncludeHeadersTells the class whether to include the headers when encoding the message.
RequireVersionHeaderSpecifies whether or not the class should require the version header.
SanitizeFilenameWhether invalid characters are replaced in MIME part filenames.
TempFilePathIf set, the temporary files created during MIME decoding and encoding will be put in the path specified.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
ProcessIdleEventsWhether the class uses its internal event loop to process events when the main thread is idle.
SelectWaitMillisThe length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.
UseInternalSecurityAPITells the class whether or not to use the system security libraries or an internal implementation.

boundary Property

The boundary separating the MIME parts. Maximum length of 80 bytes.

Syntax

def get_boundary() -> str: ...

def set_boundary(value: str) -> None: ...


boundary = property(get_boundary, set_boundary)

Default Value

""

Remarks

This property contains the boundary separating the MIME parts and has a maximum length of 80 bytes. The class will automatically generate a random boundary value during encoding if no value is given. During decoding this property is filled with the boundary from the actual MIME message.

The class will truncate any string longer than 80 bytes if assigned to boundary.

content_type Property

The value of the content-type header of the message which was encoded/decoded.

Syntax

def get_content_type() -> str: ...

def set_content_type(value: str) -> None: ...


content_type = property(get_content_type, set_content_type)

Default Value

""

Remarks

This property contains the value of the content-type header of the message which was encoded/decoded. The class filters it out from the message_headers. It shows the user about the type of the parts and their relation to each other.

The content-type attributes such as filename, boundary, charset etc are held in this property.

content_type_attr Property

The attributes for content-type header of the message which was encoded/decoded.

Syntax

def get_content_type_attr() -> str: ...

def set_content_type_attr(value: str) -> None: ...


content_type_attr = property(get_content_type_attr, set_content_type_attr)

Default Value

""

Remarks

This property contains content-type attributes such as "filename", "boundary", "charset", etc.

message Property

Contains the encoded message text or a path to a file which contains the encoded message text.

Syntax

def get_message() -> bytes: ...

def set_message(value: bytes) -> None: ...


message = property(get_message, set_message)

Default Value

""

Remarks

This property contains the encoded message text or a path to a file which contains the encoded message text. The class fills out this property with the message body and message_headers during encoding. The user may assign both the headers and the body to this property and leave message_headers empty before decoding.

message_header_count Property

The number of records in the MessageHeader arrays.

Syntax

def get_message_header_count() -> int: ...

def set_message_header_count(value: int) -> None: ...


message_header_count = property(get_message_header_count, set_message_header_count)

Default Value

0

Remarks

This property controls the size of the following arrays:

The array indices start at 0 and end at message_header_count - 1.

message_header_field Property

This property contains the name of the HTTP header (same case as it is delivered).

Syntax

def get_message_header_field(message_header_index: int) -> str: ...

def set_message_header_field(message_header_index: int, value: str) -> None: ...

Default Value

""

Remarks

This property contains the name of the HTTP Header (same case as it is delivered).

The message_header_index parameter specifies the index of the item in the array. The size of the array is controlled by the message_header_count property.

message_header_value Property

This property contains the header contents.

Syntax

def get_message_header_value(message_header_index: int) -> str: ...

def set_message_header_value(message_header_index: int, value: str) -> None: ...

Default Value

""

Remarks

This property contains the Header contents.

The message_header_index parameter specifies the index of the item in the array. The size of the array is controlled by the message_header_count property.

message_headers_string Property

String version of the MIME message headers.

Syntax

def get_message_headers_string() -> str: ...

def set_message_headers_string(value: str) -> None: ...


message_headers_string = property(get_message_headers_string, set_message_headers_string)

Default Value

""

Remarks

The component fills out message_headers_string upon encoding. The user should use them as additional headers when emailing the message.

This property contains a string version of the MIME message headers. During decoding, if this property is empty the class will try to find the headers in the beginning of the message and will fill out this property accordingly.

part_count Property

The number of records in the Part arrays.

Syntax

def get_part_count() -> int: ...

def set_part_count(value: int) -> None: ...


part_count = property(get_part_count, set_part_count)

Default Value

0

Remarks

This property controls the size of the following arrays:

The array indices start at 0 and end at part_count - 1.

part_content_disposition Property

Content disposition for each part.

Syntax

def get_part_content_disposition(part_idx: int) -> str: ...

def set_part_content_disposition(part_idx: int, value: str) -> None: ...

Default Value

""

Remarks

Content disposition for each part.

The value in this property is used in the Content-Disposition header. Typical values include "form-data", "attachment" etc. The class fills it out each time the part_decoded_file is changed. Changing the part_content_disposition recalculates the part_headers as well.

The part_idx parameter specifies the index of the item in the array. The size of the array is controlled by the part_count property.

part_content_disposition_attr Property

The content disposition's attribute (if any) for each part.

Syntax

def get_part_content_disposition_attr(part_idx: int) -> str: ...

def set_part_content_disposition_attr(part_idx: int, value: str) -> None: ...

Default Value

""

Remarks

The content disposition's attribute (if any) for each part.

Typical values for this property are the names of the form-variables while creating an HTTP post, values for filenames etc.

Setting this property recalculates the part_headers.

The part_idx parameter specifies the index of the item in the array. The size of the array is controlled by the part_count property.

part_content_id Property

Content identifier for each part.

Syntax

def get_part_content_id(part_idx: int) -> str: ...

def set_part_content_id(part_idx: int, value: str) -> None: ...

Default Value

""

Remarks

Content identifier for each part. The value of this property is used in the Content-Id header. The class fills it out each time the part_decoded_file is changed. Changing This property recalculates the part_headers as well.

The part_idx parameter specifies the index of the item in the array. The size of the array is controlled by the part_count property.

part_content_type Property

Content type for each part.

Syntax

def get_part_content_type(part_idx: int) -> str: ...

def set_part_content_type(part_idx: int, value: str) -> None: ...

Default Value

""

Remarks

Content type for each part. The value of this property is used in the Content-Type header. Typical values include "image/gif", "text/plain" etc. The class fills it out each time the part_decoded_file is changed. Changing This property recalculates the part_headers as well.

The part_idx parameter specifies the index of the item in the array. The size of the array is controlled by the part_count property.

part_content_type_attr Property

The content type attribute, if any, for each part.

Syntax

def get_part_content_type_attr(part_idx: int) -> str: ...

def set_part_content_type_attr(part_idx: int, value: str) -> None: ...

Default Value

""

Remarks

The content type attribute, if any, for each part. Setting this recalculates the part_headers as well.

The part_idx parameter specifies the index of the item in the array. The size of the array is controlled by the part_count property.

part_decoded_file Property

The filename with the decoded data.

Syntax

def get_part_decoded_file(part_idx: int) -> str: ...

def set_part_decoded_file(part_idx: int, value: str) -> None: ...

Default Value

""

Remarks

The filename with the decoded data. Accessing this property for the first time after calling the on_decode_from_string or on_decode_from_file method, directs the class to actually decode the part and save the data in a temporary file. The user is responsible for deleting the temporary file.

Setting a value to part_decoded_file directs the component to calculate the file size and fill out the respective part_size.

Note: It is recommended to use the on_decode_part_to_file method instead of querying this property.

The part_idx parameter specifies the index of the item in the array. The size of the array is controlled by the part_count property.

part_decoded_string Property

This property holds the actual content of each part.

Syntax

def get_part_decoded_string(part_idx: int) -> bytes: ...

def set_part_decoded_string(part_idx: int, value: bytes) -> None: ...

Default Value

""

Remarks

This property holds the actual content of each part. The class decodes the actual part of message to part_decoded_string when part_decoded_string's value is first queried.

Setting a value to part_decoded_string fills out the corresponding part_size with the string size if the corresponding part_decoded_file is empty.

The class checks during encoding first part_decoded_file: if it is empty then the class uses the value of part_decoded_string.

Note: It is recommended to use the on_decode_part method instead of querying this property.

The part_idx parameter specifies the index of the item in the array. The size of the array is controlled by the part_count property.

part_encoding Property

This property contains the actual content encoding type for each part.

Syntax

def get_part_encoding(part_idx: int) -> int: ...

def set_part_encoding(part_idx: int, value: int) -> None: ...

Default Value

0

Remarks

This property contains the actual content encoding type for each part. This property determines how to encode the data or how they were actually encoded in the message as specified in the Content-Transfer-Encoding header.

Possible values for the this property are:

pe7bit (0)7 Bit data, no encoding.
peQuotedPrintable (1)Quoted-Printable encoding of (typically) text.
peBase64 (2)Base64 encoding of binary data.
pe8Bit (3)No encoding, 8 Bit characters may be contained as well.
peBinary (4)Binary data without any encoding. Similar to 3 (8 Bit encoding).
peUUEncode (5)Uuencoding of binary data.

The part_idx parameter specifies the index of the item in the array. The size of the array is controlled by the part_count property.

part_filename Property

This property contains the filename attribute specified in the headers of the part.

Syntax

def get_part_filename(part_idx: int) -> str: ...

def set_part_filename(part_idx: int, value: str) -> None: ...

Default Value

""

Remarks

This property contains the filename attribute specified in the headers of the part. Changing the value of the corresponding part_decoded_file sets automatically the part_filename and consequently the part_headers.

The part_idx parameter specifies the index of the item in the array. The size of the array is controlled by the part_count property.

part_headers Property

This property contains the headers for each MIME part.

Syntax

def get_part_headers(part_idx: int) -> str: ...

def set_part_headers(part_idx: int, value: str) -> None: ...

Default Value

""

Remarks

This property contains the headers for each MIME part. The class fills out this property each time any of the other corresponding Part- properties is changed. If additional headers are needed, they should be appended after all the other corresponding Part- properties are set.

The part_idx parameter specifies the index of the item in the array. The size of the array is controlled by the part_count property.

part_name Property

This property contains the name given to a part, such as the filename.

Syntax

def get_part_name(part_idx: int) -> str: ...

def set_part_name(part_idx: int, value: str) -> None: ...

Default Value

""

Remarks

This property contains the name given to a part, such as the filename. Changing the value of part_decoded_file sets automatically the corresponding part_name and consequently the part_headers.

The part_idx parameter specifies the index of the item in the array. The size of the array is controlled by the part_count property.

part_size Property

This property contains the size of the DecodedFile or DecodedString .

Syntax

def get_part_size(part_idx: int) -> int: ...

Default Value

0

Remarks

This property contains the size of the part_decoded_file or part_decoded_string. If a non empty value is assigned to part_decoded_file, then class fills out the corresponding part_size with the file size or an error occurs if the file doesn't exist.

If the part_decoded_file is empty and a value is assigned to part_decoded_string, then the corresponding part_size will be equal to the string's size.

During decoding, this property is filled with the size of that part.

The part_idx parameter specifies the index of the item in the array. The size of the array is controlled by the part_count property.

This property is read-only.

config Method

Sets or retrieves a configuration setting.

Syntax

def config(configuration_string: str) -> str: ...

Remarks

on_config is a generic method available in every class. It is used to set and retrieve configuration settings for the class.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the on_config method.

To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.

decode_from_file Method

Decodes from file.

Syntax

def decode_from_file() -> None: ...

Remarks

This method decodes the data file given in message and optionally message_headers and fills out the parts properties for each decoded part.

Example (Decoding From File)

MIMEControl.Message = "C:\filename.txt" MIMEControl.DecodeFromFile

Here, C:\filename.txt must contain the MIME headers and body. If not, the message_headers property must also be set to the appropriate MIME headers.

decode_from_string Method

Decodes from string.

Syntax

def decode_from_string() -> None: ...

Remarks

This method decodes from string. Same as DecodeFromFile, but now the message denotes the real encoded message rather than a filename.

This method decodes the data given in message and optionally message_headers and fills out the parts properties.

Example (Decoding Mail Message)

MIMEControl.MessageHeadersString = MailControl.MessageHeaders MIMEControl.Message = MailControl.MessageText MIMEControl.DecodeFromString

decode_part Method

Decodes the specified part.

Syntax

def decode_part(index: int) -> bytes: ...

Remarks

This method decodes the part specified by Index and returns the decoded part data.

decode_from_string or decode_from_file must be called before calling this method. Calling this method will return the decoded bytes, and in addition the part_decoded_string property will be populated with the string representation of the decoded data.

For instance: mime.MessageHeadersString = myMessageHeaders; mime.Message = myMessageBody; mime.DecodeFromString(); byte[] myPartContent = await mime.DecodePart(0);

decode_part_to_file Method

Decodes the specified part to a file on disk.

Syntax

def decode_part_to_file(index: int) -> str: ...

Remarks

This method decodes the part specified by Index to a temporary file. The full path to the temporary file is returned by this method. The user is responsible for deleting the temporary file.

decode_from_string or decode_from_file must be called before calling this method.

encode_to_file Method

Encodes to file.

Syntax

def encode_to_file() -> None: ...

Remarks

This method encodes the data given in parts properties (either decoded file or decoded string) into a MIME message at message and message_headers using the values optionally given in parts properties. To encode several objects into a MIME envelope, the user should first clear any old values left in the parts properties.

The class will check for each item in parts properties (first decoded file and then the decoded string) for the data to encode.

The encoded message will be saved in the file pointed to by message; the message headers will be held by message_headers.

Example (Encoding Data)

MIMEControl.ResetData() MIMEControl.PartCount = 2 MIMEControl.PartDecodedString(0) = "This is plain text data" MIMEControl.PartEncoding(0) = peQuotedPrintable MIMEControl.PartContentType(0) = "text/plain" MIMEControl.PartDecodedFile(1) = "C:\filename.txt" MIMEControl.Message = "temp.tmp" MIMEControl.EncodeToFile()

encode_to_string Method

Encodes to string.

Syntax

def encode_to_string() -> None: ...

Remarks

This method encodes to string. Same as encode_to_file but the encoded data is held in the message property rather than saved to a file.

This method encodes the data given in parts properties into a MIME message. The Message gets stored in message and message_headers using the values optionally given in parts properties. To encode several objects into a MIME envelope, the user should first clear any old values left in the parts properties by calling reset_data.

The class will check each item in parts properties (first decoded file and then decoded string) for the data to encode.

The encoded message will be stored in the message property; the message headers will be held by message_headers.

Example (Encoding Data)

MIMEControl.ResetData() MIMEControl.PartCount = 2 MIMEControl.PartDecodedString(0) = "This is plain text data" MIMEControl.PartEncoding(0) = peQuotedPrintable MIMEControl.PartContentType(0) = "text/plain" MIMEControl.PartDecodedFile(1) = "C:\filename.txt" MIMEControl.EncodeToString()

reset Method

Reset the class.

Syntax

def reset() -> None: ...

Remarks

This method will reset the class's properties to their default values.

reset_data Method

Resets the values of all headers and Part- properties.

Syntax

def reset_data() -> None: ...

Remarks

This method resets the values of all headers and Part- properties. It is an easy way to reset the class's properties before starting to populate the Part- properties with new values.

on_error Event

Information about errors during data delivery.

Syntax

class MIMEErrorEventParams(object):
  @property
  def error_code() -> int: ...

  @property
  def description() -> str: ...

# In class MIME:
@property
def on_error() -> Callable[[MIMEErrorEventParams], None]: ...
@on_error.setter
def on_error(event_hook: Callable[[MIMEErrorEventParams], None]) -> None: ...

Remarks

The on_error event is fired in case of exceptional conditions during message processing. Normally the class fails with an error.

ErrorCode contains an error code and Description contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.

on_header Event

Fired every time a header is parsed.

Syntax

class MIMEHeaderEventParams(object):
  @property
  def part_index() -> int: ...

  @property
  def field() -> str: ...

  @property
  def value() -> bytes: ...

# In class MIME:
@property
def on_header() -> Callable[[MIMEHeaderEventParams], None]: ...
@on_header.setter
def on_header(event_hook: Callable[[MIMEHeaderEventParams], None]) -> None: ...

Remarks

The PartIndex parameter contains the index of the part containing the current header. If the header is from the MIME body, this value will be -1. The Field parameter contains the name of the MIME header. The Value parameter contains the header contents. The on_header event is fired when a header is parsed, which occurs for each header of the Message when decode_from_file, decode_from_string, or decode_from_stream is called.

on_progress Event

Shows the progress of decoding/encoding the input data.

Syntax

class MIMEProgressEventParams(object):
  @property
  def percent_done() -> int: ...

# In class MIME:
@property
def on_progress() -> Callable[[MIMEProgressEventParams], None]: ...
@on_progress.setter
def on_progress(event_hook: Callable[[MIMEProgressEventParams], None]) -> None: ...

Remarks

The on_progress allows the user to visualize the progress of processing the input data.

The PercentDone parameter shows what percentage of the input has been read.

MIME Configuration

The class accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the config method.

MIME Configuration Settings

DecodeMessageHeaders:   Instructs the component to automatically decode message headers.

Message headers that have been Quoted-Printable or Base-64 encoded are automatically decoded when this configuration setting is True. The default value of this setting is False.

IncludeHeaders:   Tells the class whether to include the headers when encoding the message.

If true, the class will include the headers when encode_to_file or encode_to_string are called. If false, only the message will be encoded.

The default value for IncludeHeaders is false.

RequireVersionHeader:   Specifies whether or not the class should require the version header.

If true, the class will require that the "MIME-Version" header be included in the message_headers. If the header is not present during decoding, the component fails with an error. This config is false by default.

SanitizeFilename:   Whether invalid characters are replaced in MIME part filenames.

If True, the class will replace invalid characters with an underscore when decoding the MIME message. This applies to the filename held in the part_filename property. When True the following characters are considered invalid:

  • \
  • /
  • "
  • :
  • ?
  • *
  • <
  • >
  • |
Any characters with ASCII values between 0-31 are also considered invalid. The default value is False.
TempFilePath:   If set, the temporary files created during MIME decoding and encoding will be put in the path specified.

The TempFilePath property sets the path at which the temporary files will be created.

Base Configuration Settings

BuildInfo:   Information about the product's build.

When queried, this setting will return a string containing information about the product's build.

CodePage:   The system code page used for Unicode to Multibyte translations.

The default code page is Unicode UTF-8 (65001).

The following is a list of valid code page identifiers:

IdentifierName
037IBM EBCDIC - U.S./Canada
437OEM - United States
500IBM EBCDIC - International
708Arabic - ASMO 708
709Arabic - ASMO 449+, BCON V4
710Arabic - Transparent Arabic
720Arabic - Transparent ASMO
737OEM - Greek (formerly 437G)
775OEM - Baltic
850OEM - Multilingual Latin I
852OEM - Latin II
855OEM - Cyrillic (primarily Russian)
857OEM - Turkish
858OEM - Multilingual Latin I + Euro symbol
860OEM - Portuguese
861OEM - Icelandic
862OEM - Hebrew
863OEM - Canadian-French
864OEM - Arabic
865OEM - Nordic
866OEM - Russian
869OEM - Modern Greek
870IBM EBCDIC - Multilingual/ROECE (Latin-2)
874ANSI/OEM - Thai (same as 28605, ISO 8859-15)
875IBM EBCDIC - Modern Greek
932ANSI/OEM - Japanese, Shift-JIS
936ANSI/OEM - Simplified Chinese (PRC, Singapore)
949ANSI/OEM - Korean (Unified Hangul Code)
950ANSI/OEM - Traditional Chinese (Taiwan; Hong Kong SAR, PRC)
1026IBM EBCDIC - Turkish (Latin-5)
1047IBM EBCDIC - Latin 1/Open System
1140IBM EBCDIC - U.S./Canada (037 + Euro symbol)
1141IBM EBCDIC - Germany (20273 + Euro symbol)
1142IBM EBCDIC - Denmark/Norway (20277 + Euro symbol)
1143IBM EBCDIC - Finland/Sweden (20278 + Euro symbol)
1144IBM EBCDIC - Italy (20280 + Euro symbol)
1145IBM EBCDIC - Latin America/Spain (20284 + Euro symbol)
1146IBM EBCDIC - United Kingdom (20285 + Euro symbol)
1147IBM EBCDIC - France (20297 + Euro symbol)
1148IBM EBCDIC - International (500 + Euro symbol)
1149IBM EBCDIC - Icelandic (20871 + Euro symbol)
1200Unicode UCS-2 Little-Endian (BMP of ISO 10646)
1201Unicode UCS-2 Big-Endian
1250ANSI - Central European
1251ANSI - Cyrillic
1252ANSI - Latin I
1253ANSI - Greek
1254ANSI - Turkish
1255ANSI - Hebrew
1256ANSI - Arabic
1257ANSI - Baltic
1258ANSI/OEM - Vietnamese
1361Korean (Johab)
10000MAC - Roman
10001MAC - Japanese
10002MAC - Traditional Chinese (Big5)
10003MAC - Korean
10004MAC - Arabic
10005MAC - Hebrew
10006MAC - Greek I
10007MAC - Cyrillic
10008MAC - Simplified Chinese (GB 2312)
10010MAC - Romania
10017MAC - Ukraine
10021MAC - Thai
10029MAC - Latin II
10079MAC - Icelandic
10081MAC - Turkish
10082MAC - Croatia
12000Unicode UCS-4 Little-Endian
12001Unicode UCS-4 Big-Endian
20000CNS - Taiwan
20001TCA - Taiwan
20002Eten - Taiwan
20003IBM5550 - Taiwan
20004TeleText - Taiwan
20005Wang - Taiwan
20105IA5 IRV International Alphabet No. 5 (7-bit)
20106IA5 German (7-bit)
20107IA5 Swedish (7-bit)
20108IA5 Norwegian (7-bit)
20127US-ASCII (7-bit)
20261T.61
20269ISO 6937 Non-Spacing Accent
20273IBM EBCDIC - Germany
20277IBM EBCDIC - Denmark/Norway
20278IBM EBCDIC - Finland/Sweden
20280IBM EBCDIC - Italy
20284IBM EBCDIC - Latin America/Spain
20285IBM EBCDIC - United Kingdom
20290IBM EBCDIC - Japanese Katakana Extended
20297IBM EBCDIC - France
20420IBM EBCDIC - Arabic
20423IBM EBCDIC - Greek
20424IBM EBCDIC - Hebrew
20833IBM EBCDIC - Korean Extended
20838IBM EBCDIC - Thai
20866Russian - KOI8-R
20871IBM EBCDIC - Icelandic
20880IBM EBCDIC - Cyrillic (Russian)
20905IBM EBCDIC - Turkish
20924IBM EBCDIC - Latin-1/Open System (1047 + Euro symbol)
20932JIS X 0208-1990 & 0121-1990
20936Simplified Chinese (GB2312)
21025IBM EBCDIC - Cyrillic (Serbian, Bulgarian)
21027Extended Alpha Lowercase
21866Ukrainian (KOI8-U)
28591ISO 8859-1 Latin I
28592ISO 8859-2 Central Europe
28593ISO 8859-3 Latin 3
28594ISO 8859-4 Baltic
28595ISO 8859-5 Cyrillic
28596ISO 8859-6 Arabic
28597ISO 8859-7 Greek
28598ISO 8859-8 Hebrew
28599ISO 8859-9 Latin 5
28605ISO 8859-15 Latin 9
29001Europa 3
38598ISO 8859-8 Hebrew
50220ISO 2022 Japanese with no halfwidth Katakana
50221ISO 2022 Japanese with halfwidth Katakana
50222ISO 2022 Japanese JIS X 0201-1989
50225ISO 2022 Korean
50227ISO 2022 Simplified Chinese
50229ISO 2022 Traditional Chinese
50930Japanese (Katakana) Extended
50931US/Canada and Japanese
50933Korean Extended and Korean
50935Simplified Chinese Extended and Simplified Chinese
50936Simplified Chinese
50937US/Canada and Traditional Chinese
50939Japanese (Latin) Extended and Japanese
51932EUC - Japanese
51936EUC - Simplified Chinese
51949EUC - Korean
51950EUC - Traditional Chinese
52936HZ-GB2312 Simplified Chinese
54936Windows XP: GB18030 Simplified Chinese (4 Byte)
57002ISCII Devanagari
57003ISCII Bengali
57004ISCII Tamil
57005ISCII Telugu
57006ISCII Assamese
57007ISCII Oriya
57008ISCII Kannada
57009ISCII Malayalam
57010ISCII Gujarati
57011ISCII Punjabi
65000Unicode UTF-7
65001Unicode UTF-8

The following is a list of valid code page identifiers for Mac OS only:

IdentifierName
1ASCII
2NEXTSTEP
3JapaneseEUC
4UTF8
5ISOLatin1
6Symbol
7NonLossyASCII
8ShiftJIS
9ISOLatin2
10Unicode
11WindowsCP1251
12WindowsCP1252
13WindowsCP1253
14WindowsCP1254
15WindowsCP1250
21ISO2022JP
30MacOSRoman
10UTF16String
0x90000100UTF16BigEndian
0x94000100UTF16LittleEndian
0x8c000100UTF32String
0x98000100UTF32BigEndian
0x9c000100UTF32LittleEndian
65536Proprietary

LicenseInfo:   Information about the current license.

When queried, this setting will return a string containing information about the license this instance of a class is using. It will return the following information:

  • Product: The product the license is for.
  • Product Key: The key the license was generated from.
  • License Source: Where the license was found (e.g., RuntimeLicense, License File).
  • License Type: The type of license installed (e.g., Royalty Free, Single Server).
ProcessIdleEvents:   Whether the class uses its internal event loop to process events when the main thread is idle.

If set to False, the class will not fire internal idle events. Set this to False to use the class in a background thread on Mac OS. By default, this setting is True.

SelectWaitMillis:   The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.

If there are no events to process when do_events is called, the class will wait for the amount of time specified here before returning. The default value is 20.

UseInternalSecurityAPI:   Tells the class whether or not to use the system security libraries or an internal implementation.

By default the class will use the system security libraries to perform cryptographic functions. Setting this to True tells the class to use the internal implementation instead of using the system's security API.

MIME Errors

MIME Errors

3   Can't create the file for write (illegal name or disk is write-protected).
4   Can't open the file for read (doesn't exist?).
5   Can't read from file.
6   Can't write to file (disk full?).
280   Invalid Part Index.
281   Unknown MIME type.
282   No MIME-boundary found.
283   No file given.
284   The class is busy.
285   Could not create a temporary file to decode the data.
286   Can't read message file.
287   No header separator found.
289   No separator found.
290   Input stream must have seeking enabled.

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