SendGrid.Net.Mime.ContentType.EncodeSubjectRFC2047 C# (CSharp) Method

EncodeSubjectRFC2047() static private method

static private EncodeSubjectRFC2047 ( string s, Encoding enc ) : string
s string
enc System.Text.Encoding
return string
        internal static string EncodeSubjectRFC2047(string s, Encoding enc)
        {
            if (s == null)
                return s;
            for (int i = 0; i < s.Length; i++)
                if (s[i] >= '\u0080')
                {
                    string quoted = To2047(enc.GetBytes(s));
                    return String.Concat("=?", enc.WebName, "?Q?", quoted, "?=");
                }
            return s;
        }