예제 #1
0
        private static void AddItem(StringBuilder sb, string key, params string[] values)
        {
            bool          encNeeded = false;
            StringBuilder tmp       = new StringBuilder();

            foreach (string value in values)
            {
                if (tmp.Length > 0)
                {
                    tmp.Append(";");
                }

                if (value == null)
                {
                    continue;
                }

                tmp.Append(EncodingUtils.EncodeQuotedPrintable(value, VcardEncoding, ref encNeeded));
            }

            sb.Append(key);

            if (encNeeded)
            {
                sb.Append(";ENCODING=QUOTED-PRINTABLE;CHARSET=");
                sb.Append(VcardEncoding.BodyName.ToUpper());
            }

            sb.Append(":");
            sb.AppendLine(tmp.ToString());
        }