Update of /cvsroot/mahogany/M/src/mail
In directory sc8-pr-cvs1:/tmp/cvs-serv26031/src/mail
Modified Files:
MailFolderCC.cpp
Log Message:
use already existing ConvertUnicodeToSystem() instead of recoding it here
Index: MailFolderCC.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MailFolderCC.cpp,v
retrieving revision 1.676
retrieving revision 1.677
diff -b -u -2 -r1.676 -r1.677
--- MailFolderCC.cpp 19 Sep 2003 13:31:22 -0000 1.676
+++ MailFolderCC.cpp 19 Sep 2003 21:48:48 -0000 1.677
@@ -1634,4 +1634,7 @@
}
+ String word(text, (size_t)len);
+ fs_give((void **)&text);
+
// normally we leave the (8 bit) string as is and remember its
// encoding so that we may choose the font for displaying it
@@ -1642,31 +1645,8 @@
encoding == wxFONTENCODING_UTF8 )
{
- // the wide string can have at most as many chars as the narrow one
- wxWCharBuffer wbuf(len);
- len = (encoding == wxFONTENCODING_UTF7 ? (wxMBConv *)&wxConvUTF7
- : (wxMBConv *)&wxConvUTF8)->
- MB2WC(wbuf.data(), text, len);
-
- // this also means that we have enough space in the old string
- // now...
- const wchar_t *pw = wbuf;
- char *p = text;
- for ( size_t n = 0; n < len; n++, pw++ )
- {
- // throw away all non ASCII chars, we have no hope of showing
- // them correctly anyhow
- //
- // do keep 8 bit chars with high bit set as they're the same as
- // iso8859-1
- *p++ = *pw > UCHAR_MAX ? '?' : *pw;
+ encoding = ConvertUnicodeToSystem(&word, encoding);
}
- // we have thrown anything else out above
- encoding = wxFONTENCODING_ISO8859_1;
- }
-
- out += String(text, (size_t)len);
-
- fs_give((void **)&text);
+ out += word;
}
else
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates