internal EncodingOptions GetDocumentEncodingOptions() { MimeDocument mimeDocument; MimeNode mimeNode; this.GetMimeDocumentOrTreeRoot(out mimeDocument, out mimeNode); if (mimeDocument != null) { return(mimeDocument.EncodingOptions); } MimePart mimePart = mimeNode as MimePart; return(new EncodingOptions((mimePart == null) ? null : mimePart.FindMimeTreeCharset())); }
internal Charset GetDefaultHeaderDecodingCharset(MimeDocument document, MimeNode treeRoot) { if (treeRoot == null) { this.GetMimeDocumentOrTreeRoot(out document, out treeRoot); } Charset charset; if (document != null) { charset = document.EffectiveHeaderDecodingOptions.Charset; } else { MimePart mimePart = treeRoot as MimePart; charset = ((mimePart == null) ? null : mimePart.FindMimeTreeCharset()); } if (charset == null) { charset = DecodingOptions.DefaultCharset; } return(charset); }