Bug 89852 - Non-ASCII characters in file name become question marks in Subject in email when a document sent by email
Summary: Non-ASCII characters in file name become question marks in Subject in email w...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.3.0.2 rc
Hardware: Other Windows (All)
: medium normal
Assignee: Andras Timar
URL:
Whiteboard: target:5.1.0 target:4.4.7 target:5.0.4
Keywords: bisected, regression
: 96079 (view as bug list)
Depends on:
Blocks: File-Name
  Show dependency treegraph
 
Reported: 2015-03-05 22:40 UTC by Serhiy
Modified: 2017-10-13 16:30 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
LO file with Cyrillic symbols in file name gives Question Marks in Subject line (180.67 KB, image/png)
2015-03-05 22:40 UTC, Serhiy
Details
File with Cyrillic symbols in file name (8.50 KB, application/vnd.oasis.opendocument.text)
2015-03-06 09:42 UTC, Serhiy
Details
Question marks in TB Subject line from LO 5.1 alfa1 x86 (20.07 KB, image/png)
2015-11-08 22:29 UTC, Serhiy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Serhiy 2015-03-05 22:40:39 UTC
Created attachment 113922 [details]
LO file with Cyrillic symbols in file name gives Question Marks in Subject line

When I save a file with the file name, containing Cyrillic symbols, e.g. as "Файл с русскими буквами в имени.odt", and then from Menu I choose File - Send - Document as E-mail, it opens my email client (Thunderbird 31.5.0), attaches the file, but in Subject line instead of the file name with Cyrillic symbols I get question marks. See the screenshot.

The same action from Microsoft Word, gives me the filename in the Subject line in correct Cyrillic symbols. That is the first reason, why I think the problem is with Libreoffice.

Another reason is that few LO versions ago (sorry, but I don't remember the version number) everything was good and I got the correct Cyrillic symbols in Subject line inmy email client.
Comment 1 Joel Madero 2015-03-06 03:44:34 UTC
Hi Serhly,

Please attach a odt that is safed with Cyrillic symbols and then mark the bug as UNCONFIRMED. Thanks.
Comment 2 Serhiy 2015-03-06 09:42:57 UTC
Created attachment 113930 [details]
File with Cyrillic symbols in file name
Comment 3 Buovjaga 2015-07-03 13:46:40 UTC
For me, it says "LibreOffice was unable to find a working e-mail configuration."
All other files are sent to my Thunderbird!

Win 7 Pro 64-bit, Version: 4.4.4.3
Build ID: 2c39ebcf046445232b798108aa8a7e7d89552ea8
Locale: fi_FI
Comment 4 Andras Timar 2015-11-06 13:19:26 UTC
(In reply to Beluga from comment #3)
> For me, it says "LibreOffice was unable to find a working e-mail
> configuration."
> All other files are sent to my Thunderbird!
> 
Even files with non-ascii characters in their filename? Can you try for example 'ä' in file name? 

On one of my test systems (Win 2003 Server) I get "LibreOffice was unable to find a working e-mail configuration." On my other test system (Win 7), I always get a mail window, but all non-ascii characters are replaced by '?' characters in subject line. 

Therefore I confirm the bug.
Comment 5 Andras Timar 2015-11-06 13:27:18 UTC
Last working version: LibreOffice 4.2.8
Regression from 4.3. Actually I tested 4.3.0.2.
Comment 6 Buovjaga 2015-11-06 14:16:08 UTC
Yeah I confirm that ä turns into ? in the subject line. Still unable to send the cyrillic file..

Win 7 Pro 64-bit, Version: 5.0.2.2 (x64)
Build ID: 37b43f919e4de5eeaca9b9755ed688758a8251fe
Locale: fi-FI (fi_FI)
Comment 7 Andras Timar 2015-11-06 14:30:56 UTC
One noteable difference is, that LibreOffice 4.2.8 sends the subject to senddoc.exe as URL encoded, while LibreOffice 4.3 and higher sends the subject as is.

I.e. in case of á.odt:
--subject %C3%A1.odt
vs.
--subject á.odt

Maybe the problem is that senddoc expects a utf-8 encoded string, and it gets utf-16. I'm investigating further...
Comment 8 Andras Timar 2015-11-06 16:17:09 UTC
The regression was caused by:
 
http://cgit.freedesktop.org/libreoffice/core/commit/?id=740fe0ce142c521d3a75558dea6535017821e127

Resolves: rhbz#1063170 Don't URI-encode filename in e-mail subject

The problem is that MAPISendMail() supports only ANSI. In fact there are two scenarios. 

1. The file name contains characters that can be represented in system's ANSI codepage. Then all can be fine, I'll push a patch shortly. 

2. The file name contains characters that *cannot* be represented in system's ANSI codepage, such as Russian file name on Beluga's computer. Then the MAPISendMail() call will fail, and LibreOffice will think that email is not configured. The solution would be to migrate to Unicode API, which is available from Windows 8 (on Windows 7 there is a workaround). A new bug should be filed for that, because it is different. (It never worked!)
Comment 9 Commit Notification 2015-11-06 16:25:13 UTC
Andras Timar committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=77ff51623eab0c5908c84400c6eb8448ddb1e9c8

tdf#89852 on Windows do not decode the filename for email subject

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2015-11-07 16:12:21 UTC
Andras Timar committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=41cf71d8b9ebaf7ff0279610138a8dc941652c7d&h=libreoffice-4-4

tdf#89852 on Windows do not decode the filename for email subject

It will be available in 4.4.7.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Buovjaga 2015-11-08 17:23:46 UTC
Still saying: "LibreOffice was unable to find a working e-mail configuration." with the cyrillic file.

Subject for ööäöäö files are shown correctly now, though.

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: 6da681442b17c723f9408a806e8d2367441ad65a
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-11-07_23:13:46
Locale: fi-FI (fi_FI)
Comment 12 Andras Timar 2015-11-08 19:33:46 UTC
(In reply to Beluga from comment #11)
> Still saying: "LibreOffice was unable to find a working e-mail
> configuration." with the cyrillic file.
>

It is expected. See comment 8.
 
> Subject for ööäöäö files are shown correctly now, though.

Thanks for testing.
Comment 13 Buovjaga 2015-11-08 19:37:03 UTC
VERIFIED, then. I wonder, why Serhiy was able to send it, though..
Comment 14 Andras Timar 2015-11-08 19:39:23 UTC
(In reply to Beluga from comment #13)
> VERIFIED, then. I wonder, why Serhiy was able to send it, though..

Probably he is Russian, and his Windows' system locale is Russian. That's why. He would have problems with 'ööäöäö' files. That's how it goes with legacy codepages.
Comment 15 Serhiy 2015-11-08 22:26:47 UTC
(In reply to Andras Timar from comment #14)
> (In reply to Beluga from comment #13)
> > VERIFIED, then. I wonder, why Serhiy was able to send it, though..
> 
> Probably he is Russian, and his Windows' system locale is Russian. That's
> why. He would have problems with 'ööäöäö' files. That's how it goes with
> legacy codepages.

1. Yes, my system locale is  Ukrainian (Cyrillic) and file ööäöäö.odt gives error "LibreOffice was unable to find a working e-mail configuration." and file isn't attached.
2. With the File with Cyrillic symbols in file name, attached to the issue, on LibreOffice 5.1.0.0.alpha1 there are no changes, I still get question marks in the Subject line. See the screenshot attached.

P.S. I marked as INVALID, because it doesn't work for me. Please, correct, if I'm wrong with the Status
Comment 16 Serhiy 2015-11-08 22:29:09 UTC
Created attachment 120394 [details]
Question marks in TB Subject line from LO 5.1 alfa1 x86

I checked this on LO version  5.1.0.0.alpha1 x86
Comment 17 Andras Timar 2015-11-08 22:37:03 UTC
Serhiy, please try a daily build as indicated in comment 10. 5.1.0.0.alpha1 was released earlier, and does not contain the fix.
Comment 18 Serhiy 2015-11-09 00:08:30 UTC
(In reply to Andras Timar from comment #17)
> Serhiy, please try a daily build as indicated in comment 10. 5.1.0.0.alpha1
> was released earlier, and does not contain the fix.

I verified with master-2015-11-07_23.13.46_LibreOfficeDev_5.1.0.0.alpha1_Win_x86_en-US_de_ar_ja_ru_qtz.msi and the issue is FIXED for Cyrillic symbols in file name, 

but file ööäöäö.odt gives error "LibreOffice was unable to find a working e-mail configuration." and file isn't attached to email. Though, as it was mentioned in comment 14 it can be regional system settings in my Windows 10
Comment 19 Commit Notification 2015-11-10 07:33:07 UTC
Andras Timar committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cf4b042c934913785ea8886b6a6b3871926c53a3&h=libreoffice-5-0

tdf#89852 on Windows do not decode the filename for email subject

It will be available in 5.0.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 20 Buovjaga 2015-11-28 18:47:50 UTC
*** Bug 96079 has been marked as a duplicate of this bug. ***