Update of /cvsroot/mahogany/M/src/mail
In directory sc8-pr-cvs1:/tmp/cvs-serv14643/src/mail

Modified Files:
        MFCache.cpp MFPool.cpp MFui.cpp MailFolder.cpp 
        MailFolderCC.cpp MailFolderCmn.cpp MailMH.cpp Message.cpp 
        MessageCC.cpp MimePartCC.cpp Pop3.cpp 
Log Message:
unicode fixes

Index: MFCache.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MFCache.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -b -u -2 -r1.25 -r1.26
--- MFCache.cpp 18 Sep 2003 16:30:58 -0000      1.25
+++ MFCache.cpp 12 Oct 2003 17:24:19 -0000      1.26
@@ -41,8 +41,8 @@
 
 // location of the cache file
-#define CACHE_FILENAME "status"
+#define CACHE_FILENAME _T("status")
 
 // the delimiter in the text file lines
-#define CACHE_DELIMITER ":"      // string, not char, to allow concatenating
+#define CACHE_DELIMITER _T(":")      // string, not char, to allow concatenating
 #define CACHE_DELIMITER_CH (CACHE_DELIMITER[0])
 
@@ -239,5 +239,5 @@
 String MfStatusCache::GetFileHeader() const
 {
-   return "Mahogany Folder Status Cache File (version %d.%d)";
+   return _T("Mahogany Folder Status Cache File (version %d.%d)");
 }
 
@@ -281,8 +281,8 @@
       // in the folder name and so the loop below looks for the first ':'
       // not followed by another ':'
-      const char *p = strchr(str, CACHE_DELIMITER_CH);
+      const wxChar *p = wxStrchr(str, CACHE_DELIMITER_CH);
       while ( p && p[1] == CACHE_DELIMITER_CH )
       {
-         p = strchr(p + 2, CACHE_DELIMITER_CH);
+         p = wxStrchr(p + 2, CACHE_DELIMITER_CH);
       }
 
@@ -306,8 +306,8 @@
       {
          case CacheFile_1_0:
-            isFmtOk = sscanf(p + 1,
-                             "%lu" CACHE_DELIMITER
-                             "%lu" CACHE_DELIMITER
-                             "%lu",
+            isFmtOk = wxSscanf(p + 1,
+                             _T("%lu") CACHE_DELIMITER
+                             _T("%lu") CACHE_DELIMITER
+                             _T("%lu"),
                              &status.total,
                              &status.unread,
@@ -320,9 +320,9 @@
 
          case CacheFile_1_1:
-            isFmtOk = sscanf(p + 1,
-                             "%lu" CACHE_DELIMITER
-                             "%lu" CACHE_DELIMITER 
-                             "%lu" CACHE_DELIMITER
-                             "%lu",
+            isFmtOk = wxSscanf(p + 1,
+                             _T("%lu") CACHE_DELIMITER
+                             _T("%lu") CACHE_DELIMITER 
+                             _T("%lu") CACHE_DELIMITER
+                             _T("%lu"),
                              &status.total,
                              &status.newmsgs,

Index: MFPool.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MFPool.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -b -u -2 -r1.9 -r1.10
--- MFPool.cpp  18 Sep 2003 16:30:58 -0000      1.9
+++ MFPool.cpp  12 Oct 2003 17:24:19 -0000      1.10
@@ -39,5 +39,5 @@
 
 // our debugging trace mask
-#define TRACE_MFPOOL "mfpool"
+#define TRACE_MFPOOL _T("mfpool")
 
 // ----------------------------------------------------------------------------
@@ -189,5 +189,5 @@
    CHECK_RET( driver, _T("MFPool::Add(): NULL driver") );
 
-   const String driverName = driver->GetName();
+   const String driverName = wxConvertMB2WX(driver->GetName());
 
    MFClassPool *pool = FindClassPool(driverName);
@@ -218,5 +218,5 @@
    CHECK( driver, NULL, _T("MFPool::Find(): NULL driver") );
 
-   MFClassPool *pool = FindClassPool(driver->GetName());
+   MFClassPool *pool = FindClassPool(wxConvertMB2WX(driver->GetName()));
    if ( !pool )
    {

Index: MFui.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MFui.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -b -u -2 -r1.4 -r1.5
--- MFui.cpp    18 Sep 2003 16:30:58 -0000      1.4
+++ MFui.cpp    12 Oct 2003 17:24:19 -0000      1.5
@@ -80,5 +80,5 @@
 
       case MessageSize_Bytes:
-         s.Printf("%lu%s", sizeBytes, verbose ? _(" bytes") : "");
+         s.Printf(_("%lu%s"), sizeBytes, verbose ? _(" bytes") : _T(""));
          break;
 
@@ -196,6 +196,6 @@
 
    String result;
-   const char *start = format.c_str();
-   for ( const char *p = start; *p; p++ )
+   const wxChar *start = format.c_str();
+   for ( const wxChar *p = start; *p; p++ )
    {
       if ( *p == '%' )

Index: MailFolder.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MailFolder.cpp,v
retrieving revision 1.303
retrieving revision 1.304
diff -b -u -2 -r1.303 -r1.304
--- MailFolder.cpp      30 Sep 2003 13:46:20 -0000      1.303
+++ MailFolder.cpp      12 Oct 2003 17:24:19 -0000      1.304
@@ -149,5 +149,5 @@
 
    // find the creation function for this kind of folders
-   MFDriver *driver = MFDriver::Get(kind);
+   MFDriver *driver = MFDriver::Get(wxConvertWX2MB(kind));
    if ( !driver )
    {
@@ -451,9 +451,9 @@
 
                // start of an URL, get it
-               if ( strncmp(++p, "mailto:";, MAILTO_LEN) != 0 )
+               if ( wxStrncmp(++p, _T("mailto:";), MAILTO_LEN) != 0 )
                {
                   wxLogDebug(_T("Unknown URL scheme in List-Post (%s)"),
                              listPostHeader.c_str());
-                  return "";
+                  return _T("");
                }
 
@@ -499,5 +499,5 @@
             {
                // posting is forbidden, hence no list posting address
-               return "";
+               return _T("");
             }
             //else: fall through
@@ -509,5 +509,5 @@
             wxLogDebug(_T("Malformed List-Post header '%s'!"),
                        listPostHeader.c_str());
-            return "";
+            return _T("");
       }
    }
@@ -716,5 +716,5 @@
       // also check if we can't find some in the message itself
       String listPostAddress;
-      if ( msg->GetHeaderLine("List-Post", listPostAddress) )
+      if ( msg->GetHeaderLine(_T("List-Post"), listPostAddress) )
       {
          listPostAddress = ExtractListPostAddress(listPostAddress);
@@ -916,5 +916,5 @@
       wxString subjectLower(subject.Lower()),
                replyPrefixLower(replyPrefixWithoutColon.Lower());
-      const char *pStart = subjectLower.c_str();
+      const wxChar *pStart = subjectLower.c_str();
       for ( ;; )
       {
@@ -923,19 +923,19 @@
          // standard string should be in lower case because we transform
          // everything to lower case)
-         static const char *replyPrefixStandard = gettext_noop("re");
+         static const wxChar *replyPrefixStandard = gettext_noop("re");
 
          // first configured string
          size_t matchLen = replyPrefixLower.length();
-         if ( strncmp(pStart, replyPrefixLower, matchLen) != 0 )
+         if ( wxStrncmp(pStart, replyPrefixLower, matchLen) != 0 )
          {
             // next the standard string
-            matchLen = strlen(replyPrefixStandard);
-            if ( strncmp(pStart, replyPrefixStandard, matchLen) != 0 )
+            matchLen = wxStrlen(replyPrefixStandard);
+            if ( wxStrncmp(pStart, replyPrefixStandard, matchLen) != 0 )
             {
                // finally the translation of the standard string
-               const char * const replyPrefixTrans =
+               const wxChar * const replyPrefixTrans =
                   wxGetTranslation(replyPrefixStandard);
-               matchLen = strlen(replyPrefixTrans);
-               if ( strncmp(pStart, replyPrefixTrans, matchLen) != 0 )
+               matchLen = wxStrlen(replyPrefixTrans);
+               if ( wxStrncmp(pStart, replyPrefixTrans, matchLen) != 0 )
                {
                   // failed to find any reply prefix
@@ -948,11 +948,11 @@
          // one of the allowed symbols -- it has to for it to count as reply
          // prefix
-         char chNext = pStart[matchLen];
+         wxChar chNext = pStart[matchLen];
          if ( chNext == '[' || chNext == '(')
          {
             // try to see if we don't have "Re[N]" string already
             int replyLevelOld;
-            if ( sscanf(pStart + matchLen, "[%d]", &replyLevelOld) == 1 ||
-                 sscanf(pStart + matchLen, "(%d)", &replyLevelOld) == 1 )
+            if ( wxSscanf(pStart + matchLen, _T("[%d]"), &replyLevelOld) == 1 ||
+                 wxSscanf(pStart + matchLen, _T("(%d)"), &replyLevelOld) == 1 )
             {
                // we've got a "Re[N]"
@@ -996,5 +996,5 @@
       {
          replyLevel++;
-         newSubject.Printf("%s[%d]: %s",
+         newSubject.Printf(_T("%s[%d]: %s"),
                            replyPrefixWithoutColon.c_str(),
                            replyLevel,
@@ -1012,8 +1012,8 @@
 
    // other headers
-   static const char *headers[] =
+   static const wxChar *headers[] =
    {
-      "Message-Id",
-      "References",
+      _T("Message-Id"),
+      _T("References"),
       NULL
    };
@@ -1030,10 +1030,10 @@
       {
          // continue "References" header on the next line
-         references += "\015\012 ";
+         references += _T("\015\012 ");
       }
       references += messageid;
 
-      cv->AddHeaderEntry("References", references);
-      cv->AddHeaderEntry("In-Reply-To", messageid);
+      cv->AddHeaderEntry(_T("References"), references);
+      cv->AddHeaderEntry(_T("In-Reply-To"), messageid);
    }
 
@@ -1043,6 +1043,6 @@
    {
       String rt;
-      msg->GetHeaderLine("To", rt);
-      cv->AddHeaderEntry("Reply-To", rt);
+      msg->GetHeaderLine(_T("To"), rt);
+      cv->AddHeaderEntry(_T("Reply-To"), rt);
    }
 
@@ -1161,5 +1161,5 @@
 
 /* static */
-bool MailFolder::SaveMessageAsMBOX(const String& filename, const char *content)
+bool MailFolder::SaveMessageAsMBOX(const String& filename, const wxChar *content)
 {
    wxFile out(filename, wxFile::write);
@@ -1171,9 +1171,9 @@
 
       // standard prefix
-      String fromLine = "From ";
+      String fromLine = _T("From ");
 
       // find the from address
-      static const char *FROM_HEADER = "From: ";
-      const char *p = strstr(content, FROM_HEADER);
+      static const wxChar *FROM_HEADER = _T("From: ");
+      const wxChar *p = wxStrstr(content, FROM_HEADER);
       if ( !p )
       {
@@ -1181,11 +1181,11 @@
          wxLogDebug(_T("Couldn't find from header in the message"));
 
-         fromLine += "MAHOGANY-DUMMY-SENDER";
+         fromLine += _T("MAHOGANY-DUMMY-SENDER");
       }
       else // take everything until the end of line
       {
          // extract just the address in angle brackets
-         p += strlen(FROM_HEADER);
-         const char *q = strchr(p, '<');
+         p += wxStrlen(FROM_HEADER);
+         const wxChar *q = wxStrchr(p, '<');
          if ( q )
             p = q + 1;
@@ -1205,5 +1205,5 @@
       time_t t;
       time(&t);
-      fromLine += ctime(&t);
+      fromLine += wxConvertMB2WX(ctime(&t));
 
       ok = out.Write(fromLine);
@@ -1212,5 +1212,5 @@
       {
          // write the body
-         size_t len = strlen(content);
+         size_t len = wxStrlen(content);
          ok = out.Write(content, len) == len;
       }

Index: MailFolderCC.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MailFolderCC.cpp,v
retrieving revision 1.683
retrieving revision 1.684
diff -b -u -2 -r1.683 -r1.684
--- MailFolderCC.cpp    12 Oct 2003 15:14:01 -0000      1.683
+++ MailFolderCC.cpp    12 Oct 2003 17:24:19 -0000      1.684
@@ -241,5 +241,5 @@
 
 /// the cclient mail folder driver name
-static const wxChar *CCLIENT_DRIVER_NAME = _T("cclient");
+static const char *CCLIENT_DRIVER_NAME = "cclient";
 
 /// our mail folder factory object
@@ -1142,5 +1142,5 @@
 // ----------------------------------------------------------------------------
 
-String MailFolderCC::ms_LastCriticalFolder = "";
+String MailFolderCC::ms_LastCriticalFolder = _T("");
 
 // ----------------------------------------------------------------------------
@@ -2573,5 +2573,5 @@
       mf->DecRef();
 
-      if ( driverName != CCLIENT_DRIVER_NAME )
+      if ( wxConvertWX2MB(driverName) != CCLIENT_DRIVER_NAME )
          continue;
 
@@ -5210,10 +5210,10 @@
 */
 void
-MailFolderCC::mm_fatal(wxChar *str)
+MailFolderCC::mm_fatal(char *str)
 {
-   GetLogCircle().Add(str);
+   GetLogCircle().Add(wxConvertMB2WX(str));
    wxLogError(_("Fatal error: %s"), str);
 
-   String msg2 = str;
+   String msg2 = wxConvertMB2WX(str);
    if(ms_LastCriticalFolder.length())
       msg2 << _("\nLast folder in a critical section was: ")
@@ -5250,5 +5250,5 @@
                           Ticket ticket)
 {
-   CHECK_DEAD(_T("Cannot list subfolder of the closed folder '%s'."));
+   CHECK_DEAD("Cannot list subfolder of the closed folder '%s'.");
 
    CHECK_RET( asmf, _T("no ASMailFolder in ListFolders") );
@@ -5297,5 +5297,5 @@
          m_ASMailFolder,
          m_Ticket,
-         "",  // empty name == no more entries
+         _T(""),  // empty name == no more entries
          0,   // no delim
          0,   // no flags
@@ -5462,5 +5462,5 @@
       // open the folder: although we don't need to do it to get its status, we
       // have to do it anyhow below, so better do it right now
-      stream = MailOpen(stream, mboxpath);
+      stream = MailOpen(stream, wxConvertWX2MB(mboxpath));
 
       if ( !stream )
@@ -5475,5 +5475,5 @@
       // get the number of messages (only)
       MAILSTATUS mailstatus;
-      MMStatusRedirector statusRedir(stream->mailbox, &mailstatus);
+      MMStatusRedirector statusRedir(wxConvertMB2WX(stream->mailbox), &mailstatus);
       mail_status(stream, stream->mailbox, SA_MESSAGES);
       nmsgs = mailstatus.messages;
@@ -5485,5 +5485,5 @@
 
       String seq;
-      seq << "1:" << nmsgs;
+      seq << _T("1:") << nmsgs;
 
       // note that ST_SILENT doesn't work for the local folders, so disable the
@@ -5769,5 +5769,5 @@
    if ( !mm_disable_callbacks )
    {
-      MailFolderCC::mm_notify(stream, str, errflg);
+      MailFolderCC::mm_notify(stream, wxConvertMB2WX(str), errflg);
    }
 }
@@ -5778,5 +5778,5 @@
    TRACE_CALLBACK3(mm_list, "%d, `%s', %ld", delim, name, attrib);
 
-   MailFolderCC::mm_list(stream, delim, name, attrib);
+   MailFolderCC::mm_list(stream, delim, wxConvertMB2WX(name), attrib);
 }
 
@@ -5786,5 +5786,5 @@
    TRACE_CALLBACK3(mm_lsub, "%d, `%s', %ld", delim, name, attrib);
 
-   MailFolderCC::mm_lsub(stream, delim, name, attrib);
+   MailFolderCC::mm_lsub(stream, delim, wxConvertMB2WX(name), attrib);
 }
 
@@ -5812,5 +5812,5 @@
    else if ( !mm_disable_callbacks )
    {
-      MailFolderCC::mm_status(stream, mailbox, status);
+      MailFolderCC::mm_status(stream, wxConvertMB2WX(mailbox), status);
    }
 }
@@ -5824,5 +5824,5 @@
       return;
 
-   String msg(str);
+   String msg = wxConvertMB2WX(str);
 
    // TODO: what's going on here?
@@ -5846,5 +5846,5 @@
    // if ( !mm_disable_callbacks )
    {
-      MailFolderCC::mm_dlog(str);
+      MailFolderCC::mm_dlog(wxConvertMB2WX(str));
    }
 }

Index: MailFolderCmn.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MailFolderCmn.cpp,v
retrieving revision 1.124
retrieving revision 1.125
diff -b -u -2 -r1.124 -r1.125
--- MailFolderCmn.cpp   3 Oct 2003 17:08:06 -0000       1.124
+++ MailFolderCmn.cpp   12 Oct 2003 17:24:19 -0000      1.125
@@ -97,8 +97,8 @@
 
 // trace mail folder ref counting
-#define TRACE_MF_REF "mfref"
+#define TRACE_MF_REF _T("mfref")
 
 // trace mask for mail folder closing
-#define TRACE_MF_CLOSE "mfclose"
+#define TRACE_MF_CLOSE _T("mfclose")
 
 // ----------------------------------------------------------------------------
@@ -692,5 +692,5 @@
       fileName = wxPFileSelector
                  (
-                  "MsgSave",
+                  _T("MsgSave"),
                   _("Choose file to save message to"),
                   NULL, NULL, NULL,
@@ -1006,5 +1006,5 @@
 
             case SearchCriterium::SC_CC:
-               msg->GetHeaderLine("CC", what);
+               msg->GetHeaderLine(_T("CC"), what);
                break;
 
@@ -1014,5 +1014,5 @@
       }
 
-      bool found = strstr(what, crit->m_Key) != NULL;
+      bool found = wxStrstr(what, crit->m_Key) != NULL;
       if ( found != crit->m_Invert )
       {
@@ -1180,5 +1180,5 @@
                      subj2 = Address::NormalizeSubject(hi2->GetSubject());
 
-                  result = Stricmp(subj1, subj2);
+                  result = wxStricmp(subj1, subj2);
                }
                break;
@@ -1204,5 +1204,5 @@
                                     );
 
-                  result = Stricmp(value1, value2);
+                  result = wxStricmp(value1, value2);
                }
                break;
@@ -1814,5 +1814,5 @@
               GetName().c_str(),
               (unsigned long)uidsNew.GetCount(),
-              folderDst ? folderDst->GetFullName().c_str() : "ourselves");
+              folderDst ? folderDst->GetFullName().c_str() : _T("ourselves"));
 
    // use the settings for the folder where the new mail is!
@@ -1971,5 +1971,5 @@
       // '%s' with the file name or add the file name at the end if
       // there is no '%s'
-      wxFileType::MessageParameters params(sound, "");
+      wxFileType::MessageParameters params(sound, _T(""));
       String command = wxFileType::ExpandCommand(soundCmd, params);
 

Index: MailMH.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MailMH.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -b -u -2 -r1.16 -r1.17
--- MailMH.cpp  2 Oct 2003 00:27:58 -0000       1.16
+++ MailMH.cpp  12 Oct 2003 17:24:19 -0000      1.17
@@ -170,5 +170,5 @@
 void MHFoldersImporter::OnNewFolder(String& name)
 {
-   wxLogMessage("Found MH folder %s", name.c_str());
+   wxLogMessage(_T("Found MH folder %s"), name.c_str());
 }
 
@@ -192,7 +192,7 @@
       // doesn't (and never under Windows)
 #ifdef OS_UNIX
-      String home = getenv("HOME");
-      String filenameMHProfile = home + "/.mh_profile";
-      FILE *fp = fopen(filenameMHProfile, "r");
+      String home = wxGetenv(_T("HOME"));
+      String filenameMHProfile = home + _T("/.mh_profile");
+      FILE *fp = wxFopen(filenameMHProfile, _T("r"));
       if ( fp )
       {
@@ -205,5 +205,5 @@
 #ifdef OS_UNIX
          // the standard location under Unix
-         String pathMH = home + "/Mail";
+         String pathMH = home + _T("/Mail");
 #else // !Unix
          // use the user directory by default
@@ -225,5 +225,5 @@
          // retrieve the MH path (notice that we don't always find it ourself
          // as sometimes it's found only by the call to mh_isvalid)
-         gs_MHRootDir = (char *)mail_parameters(NULL, GET_MHPATH, &tmp);
+         gs_MHRootDir = (wxChar *)mail_parameters(NULL, GET_MHPATH, &tmp);
 
          // the path should have a trailing [back]slash
@@ -311,5 +311,5 @@
                                              MF_MH,
                                              0,       // flags
-                                             "",
+                                             _T(""),
                                              FALSE);  // don't notify
    if ( !folderMH )
@@ -332,5 +332,5 @@
       {
          MHFoldersImporter importer;
-         asmf->ListFolders("*", FALSE, "", &importer);
+         asmf->ListFolders(_T("*"), FALSE, _T(""), &importer);
 
          ok = importer.IsOk();

Index: Message.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/Message.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -b -u -2 -r1.35 -r1.36
--- Message.cpp 30 Sep 2003 13:46:21 -0000      1.35
+++ Message.cpp 12 Oct 2003 17:24:19 -0000      1.36
@@ -87,5 +87,5 @@
          if ( !fullname->empty() )
          {
-            *fullname += ", ";
+            *fullname += _T(", ");
          }
 
@@ -128,9 +128,9 @@
    SplitAddress(address, &fullname);
 
-   const char *start = fullname.c_str();
+   const wxChar *start = fullname.c_str();
 
    // the last name is the last word in the name part
    String last;
-   const char *p = start + fullname.length() - 1;
+   const wxChar *p = start + fullname.length() - 1;
    while ( p >= start && !isspace(*p) )
       last += *p--;
@@ -432,5 +432,5 @@
                             wxFontEncoding *encoding) const
 {
-   const char *headers[2];
+   const wxChar *headers[2];
    headers[0] = line.c_str();
    headers[1] = NULL;

Index: MessageCC.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MessageCC.cpp,v
retrieving revision 1.146
retrieving revision 1.147
diff -b -u -2 -r1.146 -r1.147
--- MessageCC.cpp       30 Sep 2003 13:46:21 -0000      1.146
+++ MessageCC.cpp       12 Oct 2003 17:24:19 -0000      1.147
@@ -144,5 +144,5 @@
 
    // move \n --> \r\n convention
-   m_msgText = strutil_strdup(strutil_enforceCRLF(text));
+   m_msgText = 
strutil_strdup(wxConvertWX2MB(strutil_enforceCRLF(wxConvertMB2WX(text))));
 
    // find end of header "\012\012" (FIXME: not "\015\012"???)
@@ -206,5 +206,5 @@
       // autodetect protocol:
       String tmp;
-      if ( GetHeaderLine("Newsgroups", tmp) )
+      if ( GetHeaderLine(_T("Newsgroups"), tmp) )
          protocol = Prot_NNTP;
    }
@@ -243,5 +243,5 @@
       case Prot_SMTP:
          {
-            static const char *headers[] = { "To", "Cc", "Bcc", NULL };
+            static const wxChar *headers[] = { _T("To"), _T("Cc"), _T("Bcc"), NULL };
             wxArrayString recipients = GetHeaderLines(headers);
 
@@ -253,5 +253,5 @@
          {
             String newsgroups;
-            GetHeaderLine("Newsgroups",newsgroups);
+            GetHeaderLine(_T("Newsgroups"), newsgroups);
             sendMsg->SetNewsgroups(newsgroups);
          }
@@ -281,5 +281,5 @@
    String header = GetHeader();
    String headerLine;
-   const char *cptr = header;
+   const wxChar *cptr = header;
    String name, value;
    do
@@ -298,13 +298,13 @@
       name = headerLine.BeforeFirst(':').Lower();
       value = headerLine.AfterFirst(':');
-      if ( name != "date" &&
-           name != "from" &&
-           name != "message-id" &&
-           name != "mime-version" &&
-           name != "content-type" &&
-           name != "content-disposition" &&
-           name != "content-transfer-encoding" )
+      if ( name != _T("date") &&
+           name != _T("from") &&
+           name != _T("message-id") &&
+           name != _T("mime-version") &&
+           name != _T("content-type") &&
+           name != _T("content-disposition") &&
+           name != _T("content-transfer-encoding") )
          sendMsg->AddHeaderEntry(name, value);
-      headerLine = "";
+      headerLine = _T("");
    }while(*cptr && *cptr != '\012');
 
@@ -326,5 +326,5 @@
    String subject;
    if ( m_Envelope )
-      subject = m_Envelope->subject;
+      subject = wxConvertMB2WX(m_Envelope->subject);
    else
       FAIL_MSG( _T("should have envelop in Subject()") );
@@ -345,5 +345,5 @@
    String date;
    if ( m_Envelope )
-      date = m_Envelope->date;
+      date = wxConvertMB2WX(m_Envelope->date);
    else
       FAIL_MSG( _T("should have envelop in Date()") );
@@ -370,5 +370,5 @@
    else
    {
-      id = m_Envelope->message_id;
+      id = wxConvertMB2WX(m_Envelope->message_id);
    }
 
@@ -391,5 +391,5 @@
       if ( !m_Envelope->ngbogus )
       {
-         newsgroups = m_Envelope->newsgroups;
+         newsgroups = wxConvertMB2WX(m_Envelope->newsgroups);
       }
       //else: what does ngbogus really mean??
@@ -412,5 +412,5 @@
    else
    {
-      ref = m_Envelope->references;
+      ref = wxConvertMB2WX(m_Envelope->references);
    }
 
@@ -431,5 +431,5 @@
    else
    {
-      inreplyto = m_Envelope->references;
+      inreplyto = wxConvertMB2WX(m_Envelope->references);
    }
 
@@ -471,9 +471,9 @@
 
 wxArrayString
-MessageCC::GetHeaderLines(const char **headersOrig,
+MessageCC::GetHeaderLines(const wxChar **headersOrig,
                           wxArrayInt *encodings) const
 {
    // loop variable for iterating over headersOrig
-   const char **headers;
+   const wxChar **headers;
 
    // we should always return the arrays of correct size, this makes the
@@ -483,5 +483,5 @@
    for ( headers = headersOrig; *headers; headers++ )
    {
-      values.Add("");
+      values.Add(_T(""));
       if ( encodings )
       {
@@ -504,6 +504,6 @@
    for ( headers = headersOrig; ; )
    {
-      scur->text.size = strlen(*headers);
-      scur->text.data = (unsigned char *)cpystr(*headers);
+      scur->text.size = strlen(wxConvertWX2MB(*headers));
+      scur->text.data = (unsigned char *)cpystr(wxConvertWX2MB(*headers));
       if ( !*++headers )
       {
@@ -534,5 +534,5 @@
 
       // extract the headers values
-      HeaderIterator hdrIter(rc);
+      HeaderIterator hdrIter(wxConvertMB2WX(rc));
       hdrIter.GetAll(&names, &valuesInDisorder);
 
@@ -651,5 +651,5 @@
       if ( !m_mailFullText )
       {
-         CHECK_DEAD_RC("");
+         CHECK_DEAD_RC(_T(""));
 
          if ( m_folder->Lock() )
@@ -692,9 +692,9 @@
       //else: already have it, reuse as msg text doesn't change
 
-      return m_mailFullText;
+      return wxConvertMB2WX(m_mailFullText);
    }
    else // from a text
    {
-      return m_msgText;
+      return wxConvertMB2WX(m_msgText);
    }
 }
@@ -1117,5 +1117,6 @@
 
 #if wxUSE_UNICODE
-   #error "We need the original encoding here, TODO"
+   #warning "We need the original encoding here, TODO"
+   return wxConvertMB2WX(p);
 #else // ANSI
    return wxString(p, len);
@@ -1285,5 +1286,5 @@
                        _T("DEBUG: Mailfolder corruption detected"));
 
-            str = String(header, (size_t)len);
+            str = wxConvertMB2WX(header);
          }
       }

Index: MimePartCC.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MimePartCC.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -b -u -2 -r1.10 -r1.11
--- MimePartCC.cpp      18 Sep 2003 16:31:00 -0000      1.10
+++ MimePartCC.cpp      12 Oct 2003 17:24:19 -0000      1.11
@@ -58,5 +58,5 @@
    for ( size_t n = 0; body_types[n]; n++ )
    {
-      if ( type == body_types[n] )
+      if ( type == wxConvertMB2WX(body_types[n]) )
       {
          m_primary = (MimeType::Primary)n;
@@ -80,5 +80,5 @@
 
    // body_types is defined in c-client/rfc822.c
-   return body_types[m_primary];
+   return wxConvertMB2WX(body_types[m_primary]);
 }
 
@@ -124,5 +124,5 @@
    // unused anyhow (the trouble is that we don't know if we're multipart or
    // not yet as m_body is not set)
-   m_spec = '1';
+   m_spec = _T('1');
 }
 
@@ -174,5 +174,5 @@
    }
 
-   m_spec << wxString::Format("%lu", (unsigned long)nPart);
+   m_spec << wxString::Format(_T("%lu"), (unsigned long)nPart);
 }
 
@@ -212,5 +212,5 @@
 {
    // cast is ok as we use the same values in MimeType as c-client
-   return MimeType((MimeType::Primary)m_body->type, m_body->subtype);
+   return MimeType((MimeType::Primary)m_body->type, wxConvertMB2WX(m_body->subtype));
 }
 
@@ -219,5 +219,5 @@
    // FIXME: we lose the encoding info here - but we don't have any way to
    //        return it from here currently
-   return MailFolder::DecodeHeader(m_body->description);
+   return MailFolder::DecodeHeader(wxConvertMB2WX(m_body->description));
 }
 
@@ -225,11 +225,11 @@
 {
    // try hard to find an acceptable name for this part
-   String filename = GetDispositionParam("filename");
+   String filename = GetDispositionParam(_T("filename"));
 
    if ( filename.empty() )
-      filename = GetParam("filename");
+      filename = GetParam(_T("filename"));
 
    if ( filename.empty() )
-      filename = GetParam("name");
+      filename = GetParam(_T("name"));
 
    return filename;
@@ -238,5 +238,5 @@
 String MimePartCC::GetDisposition() const
 {
-   return m_body->disposition.type;
+   return wxConvertMB2WX(m_body->disposition.type);
 }
 
@@ -291,5 +291,5 @@
    while ( par )
    {
-      list->push_back(new MimeParameter(par->attribute, par->value));
+      list->push_back(new MimeParameter(wxConvertMB2WX(par->attribute), 
wxConvertMB2WX(par->value)));
 
       par = par->next;
@@ -356,5 +356,5 @@
 wxFontEncoding MimePartCC::GetTextEncoding() const
 {
-   String charset = GetParam("charset");
+   String charset = GetParam(_T("charset"));
 
    return charset.empty() ? wxFONTENCODING_SYSTEM

Index: Pop3.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/Pop3.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -b -u -2 -r1.6 -r1.7
--- Pop3.cpp    15 Sep 2003 17:01:40 -0000      1.6
+++ Pop3.cpp    12 Oct 2003 17:24:19 -0000      1.7
@@ -93,5 +93,5 @@
 {
    String folderNameFixed = folderName;
-   folderNameFixed.Replace("/", "_");
+   folderNameFixed.Replace(_T("/"), _T("_"));
 
    String filename;
@@ -131,5 +131,5 @@
 String PopFlagsCacheFile::GetFileHeader() const
 {
-   return "Mahogany POP3 Flags Cache File (version %d.%d)";
+   return _T("Mahogany POP3 Flags Cache File (version %d.%d)");
 }
 
@@ -147,5 +147,5 @@
    {
       int flags;
-      bool ok = sscanf(file[n], "%s %d",
+      bool ok = wxSscanf(file[n], _T("%s %d"),
                        uidl.GetWriteBuf(file[n].length()), &flags) == 2;
       uidl.UngetWriteBuf();
@@ -206,5 +206,5 @@
       }
 
-      str.Printf("%s %d\n", m_uidls->Item(msgno - 1).c_str(), flags);
+      str.Printf(_T("%s %d\n"), m_uidls->Item(msgno - 1).c_str(), flags);
 
       if ( !file.Write(str) )



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to