Decode() public static method

public static Decode ( string text, string charset ) : string
text string
charset string
return string
Example #1
0
        internal string GetTextMessage(string buffer)
        {
            // find "\r\n\r\n" denoting end of header
            int start = buffer.IndexOf("\r\n\r\n") + 4;
            int end   = buffer.LastIndexOf("\r\n.\r\n");

            //change charset if contentTransferEncoding is 8bit
            if (this.contentTransferEncoding.IndexOf("8bit") != -1)
            {
                return(StringOperations.Change(buffer.Substring(start, end - start), charset));
            }
            else if (this.contentTransferEncoding.IndexOf("base64") != -1)
            {
                return(StringOperations.Decode(buffer.Substring(start, end - start), charset));
            }
            else
            {
                return(buffer.Substring(start, end - start));
            }
        }