CodepageMode Property
Indicates how to convert message content between
Internet codepages and Windows codepages. MailBee performs this conversion when
the message is decoded from raw data into Message object.
Consider setting this property if "???" instead of international characters
appear in messages after decoding.
Another case to set this property is to tell MailBee how to handle Unicode content
(UTF7/UTF8) because such content cannot be represented in ordinal 8bit characters.
Options supported:
Let's imagine that source message uses "iso-2022-kr" charset (Content
codepage=50225), and MailBee operates under US Windows system (System codepage=1252).
If CodepageMode=0 (default setting), MailBee decodes the message
into default codepage (Codepage=1252 in this example). This allows viewing the
message on US Windows system. However, symbols that cannot be represented in
US Windows system will be replaced with "?".
If CodepageMode=1, MailBee decodes the message into Codepage=949
(Windows codepage for Korean). This will not allow you to view the message on
US Windows system due lack of Korean fonts. However, the decoded text can be
transmitted to Korean system where it can be successfully read. So, this mode
is fine when machines that decode mail and display it to the user are different,
and only one of them supports destination codepage.
If CodepageMode=2, MailBee will act like CodepageMode=1
because the source codepage (50225) is not a Unicode codepage.
If CodepageMode=3, MailBee will retain 50225 codepage for the message data. To display it, you'll need to specify the charset information (for instance, in <META> tag). This works for HTML only because plain-text viewers do not understand charset settings.
Note: This property is useful for decoding messages
loaded from disk using ImportFromFile
method or directly loaded through RawBody
property. To set Codepage/CodepageMode for messages being received
from POP3 server use Codepage/CodepageMode properties of POP3
object.
| Value Type: | Long | |
| Parameters: | None | |
Usage example:
Dim Msg 'Using visual basic to create object Set Msg = CreateObject("MailBee.Message") 'Using ASP to create object 'Set Msg = Server.CreateObject("MailBee.Message") 'In ASP use Response.Write instead of MsgBox Msg.CodepageMode = 1 ' Always autodetect codepage. Codepage property will be ignored Msg.ImportFromFile "C:\msg_with_international_symbols.eml" MsgBox Msg.BodyText
See Also:
Codepage
Property
ImportFromFile Method
POP3.Codepage Property
POP3.CodepageMode Property
Copyright 2002-2010, AfterLogic Corporation. All rights reserved.