4D v13.2

POP3_Charset

Home

 
4D v13.2
POP3_Charset

POP3_Charset 


 

POP3_Charset ( decodeHeaders ; bodyCharset ) -> Function result 
Parameter Type   Description
decodeHeaders  Integer in -1 = Use current settings, 0 = Do not manage, 1 = Convert using the Mac OS charset if ISO-8859-1 or ISO-2022-JP, decode extended characters
bodyCharset  Integer in -1 = Use current settings, 0 = Do not manage, 1 = Convert using the Mac OS charset if ISO-8859-1 or ISO-2022-JP
Function result  Integer in Error Code

The POP3_Charset command allows automatic support of messages containing extended characters while processing them with the POP3 and MSG commands. If this command is not called or has parameters set to 0, version 6.7 or higher of 4D Internet Commands will work the same way as version 6.5.x.

POP3_Charset allows first, to set whether the extended characters header decoding has to be managed, and second, whether the message body and headers character set conversions have to be managed.
This command is particularly usefull to support extended characters included in message headers such as “Subject” or mail addresses (for example, to decode an address such as “=?ISO-8859-1?Q?Test=E9?= <test@n.net >”).

The decodeHeaders parameter specifies how to handle header decoding and conversion while executing commands POP3_MsgLst or MSG_FindHeader(see Compatibility note). Default value is set to 0.

  • -1: Use current settings;
  • 0: Do not manage;
  • 1: Headers are decoded if necessary. If decoded and if the specified character set is ISO-8859-1 or ISO-2022-JP, headers are converted using respectively the Mac OS ASCII code or the Shift-JIS.

Compatibility note (version 6.8.1): POP3_Charset applies to MSG_FindHeader (in the same way as POP3_MsgLst) if the MSG_Charset command has not been executed previously.

The bodyCharset parameter specifies how to handle message body character set conversion while executing the MSG_GetBody command (see Compatibility note). Default value is set to 0.

  • -1: Use current settings;
  • 0: Do not manage;
  • 1: If the “Body-Content-Type” character set is set to ISO-8859-1 or ISO-2022-JP, the message body is converted using respectively the Mac OS ASCII code or the Shift-JIS.

Compatibility note (version 6.8.1): POP3_Charset applies to MSG_GetBody if the MSG_Charset command has not been executed previously.

Using version 6.5.x of 4D Internet Commands:

 $Err:=MSG_FindHeader($msgfile;"From";$from)
 $from:=ISO to Mac($from)
 $Err:=MSG_FindHeader($msgfile;"To";$to)
 $to:=ISO to Mac($to)
 $Err:=MSG_FindHeader($msgfile;"Cc";$cc)
 $cc:=ISO to Mac($cc)
 $Err:=MSG_FindHeader($msgfile;"Subject";$subject)
 $subject:=ISO to Mac($subject)
 
 $Err:=MSG_MessageSize($msgfile;$HdrSize;$BdySize;$MsgSize)
 $Err:=MSG_GetBody($msgfile;0;$BdySize;$BodyContent)
 $BodyContent:=ISO to Mac($BodyContent)

Using version 6.7 of 4D Internet Commands:

 $Err:=POP3_Charset(1;1)
 $Err:=MSG_FindHeader($msgfile;"From";$from)
 $Err:=MSG_FindHeader($msgfile;"To";$to)
 $Err:=MSG_FindHeader($msgfile;"Cc";$cc)
 $Err:=MSG_FindHeader($msgfile;"Subject";$subject)
 
 $Err:=MSG_MessageSize($msgfile;$HdrSize;$BdySize;$MsgSize)
 $Err:=MSG_GetBody($msgfile;0;$BdySize;$BodyContent)

Using version 6.8 of 4D Internet Commands:

 $Err:=MSG_Charset(1;1)
 $Err:=MSG_FindHeader($msgfile;"From";$from)
 $Err:=MSG_FindHeader($msgfile;"To";$to)
 $Err:=MSG_FindHeader($msgfile;"Cc";$cc)
 $Err:=MSG_FindHeader($msgfile;"Subject";$subject)
 
 $Err:=MSG_MessageSize($msgfile;$HdrSize;$BdySize;$MsgSize)
 $Err:=MSG_GetBody($msgfile;0;$BdySize;$BodyContent)

 
PROPERTIES 

Product: 4D
Theme: IC POP3 Review Mail
Number: 88891

 
INDEX

Alphabetical list of commands

 
HISTORY 

Modified: 4D Internet Commands 6.8.1

 
SEE ALSO 

MSG_Charset
SMTP_Charset