Alert the user if the subject contains out of range characters of the mail charset, r=ducarroz, bug 28908.
git-svn-id: svn://10.0.0.236/trunk@68126 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
13390017dc
commit
6a4d4fab5d
@ -38,6 +38,7 @@
|
||||
#include "nsSpecialSystemDirectory.h"
|
||||
#include "nsIDocumentEncoder.h" // for editor output flags
|
||||
#include "nsIURI.h"
|
||||
#include "nsMsgPrompts.h"
|
||||
|
||||
/* for StrAllocCat */
|
||||
#include "xp_str.h"
|
||||
@ -637,6 +638,18 @@ mime_generate_headers (nsMsgCompFields *fields,
|
||||
}
|
||||
|
||||
if (pSubject && *pSubject) {
|
||||
// alert the user if the subject contains characters out of charset range (e.g. multilingual data)
|
||||
nsAutoString u; // need to convert from UTF-8 to UCS2
|
||||
if (NS_OK == nsMsgI18NConvertToUnicode(msgCompHeaderInternalCharset(), pSubject, u) &&
|
||||
!nsMsgI18Ncheck_data_in_charset_range(charset, u)) {
|
||||
PRBool proceedTheSend;
|
||||
rv = nsMsgAskBooleanQuestionByID(NS_MSG_MULTILINGUAL_SEND, &proceedTheSend);
|
||||
if (!proceedTheSend) {
|
||||
*status = NS_ERROR_BUT_DONT_SHOW_ALERT;
|
||||
return nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
char *convbuf;
|
||||
PUSH_STRING ("Subject: ");
|
||||
convbuf = nsMsgI18NEncodeMimePartIIStr((char *)pSubject, charset,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user