Revision: 7474
          http://mahogany.svn.sourceforge.net/mahogany/?rev=7474&view=rev
Author:   vadz
Date:     2008-05-05 17:39:31 -0700 (Mon, 05 May 2008)

Log Message:
-----------
last change broke display of non-ASCII messages when uudecode filter was 
active; fix this by restoring the use of wxChar when working with message 
contents

Modified Paths:
--------------
    trunk/M/src/modules/viewflt/UUDecode.cpp

Modified: trunk/M/src/modules/viewflt/UUDecode.cpp
===================================================================
--- trunk/M/src/modules/viewflt/UUDecode.cpp    2008-05-05 01:28:51 UTC (rev 
7473)
+++ trunk/M/src/modules/viewflt/UUDecode.cpp    2008-05-06 00:39:31 UTC (rev 
7474)
@@ -93,7 +93,7 @@
 {
 
 // check if c is valid in uuencoded text
-inline bool IsUUValid(char c)
+inline bool IsUUValid(wxChar c)
 {
    return c >= ' ' && c <= '`';
 }
@@ -103,7 +103,7 @@
 // "decode" a single character
 #define UUdec(c)    (((c) - ' ') & 077)
 
-int UUdecodeLine(const char *input, char *output, const char **endOfLine)
+int UUdecodeLine(const wxChar *input, char *output, const wxChar **endOfLine)
 {
    if ( !IsUUValid(*input) )
       return -1;
@@ -112,7 +112,7 @@
    if ( cv_len > MAX_UU_LINE_LEN )
       return -1;
 
-   // Actually decode the uue data; ensure characters are in range.
+   // Actually decode the uuencoded data; ensure characters are in range.
    for ( int i = 0; i < cv_len; i += 3, input += 4 )
    {
       if ( !IsUUValid(input[0]) || !IsUUValid(input[1]) ||
@@ -134,9 +134,9 @@
 }
 
 bool
-UUdecodeFile(const char *input,
+UUdecodeFile(const wxChar *input,
              wxMemoryBuffer& output,
-             const char **endOfEncodedStream)
+             const wxChar **endOfEncodedStream)
 {
    static const size_t allocationSize = 10000;
 
@@ -144,8 +144,8 @@
 
    size_t totalDecodedBytes = 0;
    int decodedBytesInLine;
-   const char *startOfLine = input;
-   const char *endOfLine = 0; // init not needed
+   const wxChar *startOfLine = input;
+   const wxChar *endOfLine = 0; // init not needed
    char buffer[MAX_UU_LINE_LEN];
    while ( (decodedBytesInLine =
                UUdecodeLine(startOfLine, buffer, &endOfLine)) > 0 )
@@ -188,8 +188,8 @@
    // do we have something looking like UUencoded data?
    static const size_t lenBegin = wxStrlen(UU_BEGIN_PREFIX);
 
-   const char *start = text.c_str();
-   const char *nextToOutput = start;
+   const wxChar *start = text.c_str();
+   const wxChar *nextToOutput = start;
    while ( *start )
    {
       bool hasBegin = wxStrncmp(start, UU_BEGIN_PREFIX, lenBegin) == 0;
@@ -223,7 +223,7 @@
       if ( !hasBegin )
       {
          // try the next line (but only if not already at the end)
-         start = wxStrchr(start, '\n');
+         start = wxStrchr(start, _T('\n'));
          if ( start )
          {
             start++;  // skip '\n' itself
@@ -240,7 +240,7 @@
          }
       }
 
-      const char *startBeginLine = start;
+      const wxChar *startBeginLine = start;
       start += lenBegin;
 
       // Let's check that the next 4 chars after the 'begin ' are
@@ -257,8 +257,8 @@
          continue;
       }
 
-      const char *startName = start+4;     // skip mode and space
-      const char *endName = startName;
+      const wxChar *startName = start+4;     // skip mode and space
+      const wxChar *endName = startName;
       // Rest of the line is the name
       while ( *endName != '\r' )
       {
@@ -278,7 +278,7 @@
                      "'begin' line does not end with \"\\r\\n\"?" );
 
       const String fileName(startName, endName);
-      const char *start_data = endName + lenEOL;
+      const wxChar *start_data = endName + lenEOL;
 
 
       // buffer with the entire virtual part contents
@@ -311,7 +311,7 @@
 
       virtData.AppendData(header.ToAscii(), header.length());
 
-      const char *endOfEncodedStream = 0;
+      const wxChar *endOfEncodedStream = NULL;
       bool ok = UUdecodeFile(start_data, virtData, &endOfEncodedStream);
       if ( ok )
       {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to