private void GetEncoding()
{
int begin, end;
begin = end = 0;
try
{
if((begin = m_strLowHeader.IndexOf("content-transfer-encoding: ")) < 0)
throw new POP3ParseException("could not find Encoding tag");
if((end = m_strHeader.Substring(begin).IndexOf("\r\n")) < 0)
throw new POP3ParseException("could not find end of Encoding tag");
end += begin;
begin += 27;
m_strEncoding = m_strHeader.Substring(begin, end - begin).ToLower();
}
protected void GetCharSet()
{
int begin, end;
begin = end = 0;
try
{
// parse buffer
if((begin = m_strLowHeader.IndexOf("charset=")) < 0)
throw new POP3ParseException ("GetCharSet could not find beginning of 'charset' tag");
if((end = m_strHeader.Substring(begin + 2).IndexOf("\"")) < 0)
throw new POP3ParseException ("GetCharSet could not find end of 'charset' tag");
// make temporary string of charset tag
string strContType = m_strHeader.Substring(begin);
// parse mime version
if((begin = strContType.IndexOf("\"")) < 0)
throw new POP3ParseException ("GetCharSet could not find leading ' '");
if((end = strContType.LastIndexOf("\"")) < 0)
throw new POP3ParseException("GetCharSet could not fine end of tag");