Exemplo n.º 1
0
   void 
   CodePages::_AddCodePage(const AnsiString &sName, int iCodePage)
   {
      AnsiString sTmp = sName;
      sTmp.ToLower();

      m_mapCodePages[sTmp] = iCodePage;
   }
Exemplo n.º 2
0
   int 
   CodePages::GetCodePage(const AnsiString &sName) const
   {
      AnsiString lowerCaseCharSet = sName;
      lowerCaseCharSet.ToLower();

      std::map<AnsiString, int>::const_iterator iter = m_mapCodePages.find(lowerCaseCharSet);

      if (iter == m_mapCodePages.end())
         return 0;

      return (*iter).second;
   }
   AnsiString 
   RelaxedCanonicalization::CanonicalizeHeaderName(AnsiString name)
   {
      /*
      Unfold all header field continuation lines as described in
      [RFC2822]; in particular, lines with terminators embedded in
      continued header field values (that is, CRLF sequences followed by
      WSP) MUST be interpreted without the CRLF.  Implementations MUST
      NOT remove the CRLF at the end of the header field value.
      */

      name.ToLower();
      name.Trim();

      return name;
   }