C# (CSharp) RemObjects.InternetPack.Messages.Mime.Decode Namespace

Сlasses

Name Description
EncodedWord Utility class for dealing with encoded word strings

EncodedWord encoded strings are only in ASCII, but can embed information about characters in other character sets.

It is done by specifying the character set, an encoding that maps from ASCII to the correct bytes and the actual encoded String.

It is specified in a format that is best summarized by a BNF:
"=?" character_set "?" encoding "?" encoded-text "?="
Rfc2231Decoder This class is responsible for decoding parameters that has been encoded with:
Continuation
This is where a single parameter has such a Int64 value that it could be wrapped while in transit. Instead multiple parameters is used on each line.

Example
From: Content-Type: text/html; boundary="someVeryLongStringHereWhichCouldBeWrappedInTransit"
To: Content-Type: text/html; boundary*0="someVeryLongStringHere" boundary*1="WhichCouldBeWrappedInTransit"
Encoding
Sometimes other characters then ASCII characters are needed in parameters.
The parameter is then given a different name to specify that it is encoded.

Example
From: Content-Disposition attachment; filename="specialCharsÆØÅ"
To: Content-Disposition attachment; filename*="ISO-8859-1'en-us'specialCharsC6D8C0"
This encoding is almost the same as EncodedWord encoding, and is used to decode the value.
Continuation and Encoding
Both Continuation and Encoding can be used on the same time.

Example
From: Content-Disposition attachment; filename="specialCharsÆØÅWhichIsSoLong"
To: Content-Disposition attachment; filename*0*="ISO-8859-1'en-us'specialCharsC6D8C0"; filename*1*="WhichIsSoLong"
This could also be encoded as:
To: Content-Disposition attachment; filename*0*="ISO-8859-1'en-us'specialCharsC6D8C0"; filename*1="WhichIsSoLong"
Notice that filename*1 does not have an * after it - denoting it IS NOT encoded.
There are some rules about this:
The encoding must be mentioned in the first part (filename*0*), which has to be encoded. No other part must specify an encoding, but if encoded it uses the encoding mentioned in the first part. Parts may be encoded or not in any order.
More information and the specification is available in RFC 2231.
StreamUtility Utility to help reading bytes and strings of a Stream
Utility Contains common operations needed while decoding.