Closed Bug 1048658 Opened 8 years ago Closed 4 years ago
Mail W for unicode messages and Windows 8
7.94 KB, application/vnd.oasis.opendocument.text
19.62 KB, patch
|Details | Diff | Splinter Review|
19.61 KB, patch
|Details | Diff | Splinter Review|
Apparently windows 8 does not support MAPISendMAil and the new MAPISendMailW replaces it. Right click > send mail to among other functions.
Windows 8 and later do support MAPISendMail. Still, a number of problems are associated with the 8-bit MAPI, that are listed in the proposed change commit message: 1. Text may be garbled. 2. Attachments may be inaccessible. 3. Attachments may fail to save. The problem #2 is when the attachment temporary file name includes characters not representable using 8-bit CP_ACP. Replacing correct character in names naturally makes files not accessible. The problem #3 is when attachment temporary file is accessible, but its user-visible name is different and contains such characters. In that case, the 8-bit string encoded in CP_ACP would contain "?", which are illegal in file names on Windows. TB tries to save the file locally with the user-visible name, which would fail, and then fail to send or save the message. The change may be tested using current master of LibreOffice, which includes a series of changes by me (starting https://cgit.freedesktop.org/libreoffice/core/commit/?id=c2f7759e85f3e5cc9f56aaf03eefa0f1ba834734) that allow using MAPISendMAilW and pass UTF-16. To test, use an attached document, which is a simple text document, that is named "aбγ.odt", thus containing a Latin, Cyrillic and Greek characters, and so isn't representable in any single codepage that could be used as active codepage on Windows (which still lacks an ability to use UTF-8 as ACP). Open the file in a LibreOffice daily from https://dev-builds.libreoffice.org/daily/master/, and use its File->Send-E-Mail Document... (of course, the TB in comm-central\obj-i686-pc-mingw32\dist\bin must be registered by using its uninstall\helper.exe /SetAsDefaultAppGlobal or /SetAsDefaultAppUser, and also regsvr32 path\to\comm-central\obj-i686-pc-mingw32\dist\bin\MapiProxy.dll; I also had to replace mozMapi32_InUse.dll with mozMapi32.dll in DLLPath under HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Mozilla Thunderbird).
Comment on attachment 9037406 [details] [diff] [review] MAPISendMailW.diff Review of attachment 9037406 [details] [diff] [review]: ----------------------------------------------------------------- ::: mailnews/mapi/mapihook/src/msgMapiHook.cpp @@ +478,5 @@ > + pFile->InitWithPath (nsDependentString(aFiles[i].lpszPathName)); > + > + bool bExist ; > + rv = pFile->Exists(&bExist) ; > + MOZ_LOG(MAPI, mozilla::LogLevel::Debug, ("nsMapiHook::HandleAttachments: filename: %s path: %s exists = %s \n", (const char*)aFiles[i].lpszFileName, (const char*)aFiles[i].lpszPathName, bExist ? "true" : "false")); I think %s is wrong here for wchar file names. See attachment 9024554 [details] [diff] [review], and there msgMapiHook.cpp and HandleAttachmentsW.
Comment on attachment 9037507 [details] [diff] [review] 1048658-MAPISendMailW.patch Works for me. My copy of LibreOffice 18.104.22.168 doesn't use the new interface, but Window own St>Mr does as per my previous observation in the duplicate bug I started. I can now send a file named テスト.txt which was possible via the non-W interface only with the system locale set to UTF-8.
Attachment #9037507 - Flags: review+
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Attachment #9037531 - Flags: approval-comm-esr60+ → review+
Comment on attachment 9038024 [details] [diff] [review] 1048658-MAPISendMailW.patch - ESR60 version Let's leave some of the fun for TB 68. We had enough MAPI chagrin in TB 60. The patch doesn't apply anyway any more.
You need to log in before you can comment on or make changes to this bug.