Bug 3454 - Attachments containing certain special characters in filename are not opened
Summary: Attachments containing certain special characters in filename are not opened
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (Windows)
Classification: Unclassified
Component: default (show other bugs)
Version: 3.13.0
Hardware: PC Windows 8
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2015-07-01 14:53 UTC by daniel
Modified: 2015-12-15 16:40 UTC (History)
1 user (show)

See Also:


Attachments

Description daniel 2015-07-01 14:53:41 UTC
When I will receive an email with attachment where filename contains national characters (like ěščřžýáíéúů), the attachment cannot be opened, can be saved to disk only.
Comment 1 Andrej Kacian 2015-08-02 23:25:40 UTC
Best I can tell, this is related to Glib charset conversion bug at <https://bugzilla.gnome.org/show_bug.cgi?id=734886>.

The error comes from procmime_get_part(), where g_fopen() returns EINVAL, after it unsuccesfully tries to convert the filename from UTF-8 to system's local codepage (NTFS stores file names as UTF-16).
Comment 2 users 2015-08-03 23:29:02 UTC
Changes related to this bug have been committed.
Please check latest Git and update the bug accordingly.
You can also get the patch from:
http://git.claws-mail.org/

++ ChangeLog	2015-08-03 23:29:02.765320760 +0200
http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=22236057acbcaa79df6667a20cdf0ad86942203a
Merge: 2efc423 4256dfb
Author: Colin Leroy <colin@colino.net>
Date:   Mon Aug 3 23:29:02 2015 +0200

    Merge branch 'master' of file:///home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=4256dfbdc81c5a900cf577bae38847bb803a45c7
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Mon Aug 3 23:24:05 2015 +0200

    Remove broken reimplementation of a few Glib file functions.
    
    This fixes bug #3454, and probably a few more.
Comment 3 Andrej Kacian 2015-08-03 23:32:29 UTC
(In reply to comment #1)
> Best I can tell, this is related to Glib charset conversion bug at
> <https://bugzilla.gnome.org/show_bug.cgi?id=734886>.

I was wrong, the issue was that we had an old, broken copy of g_fopen() in our code (common/utils.c), which was used instead of Glib's proper g_fopen() function. With that copy removed, saving attachments like "ěščřžýáíéúů.txt" works correctly on Windows.
Comment 4 daniel 2015-10-11 23:59:13 UTC
With version 3.13. problem remains. In your last comment You said files will special characters can be saved. That is true. But they cannot be opened.
Comment 5 daniel 2015-10-12 00:00:04 UTC
I wanted to change platform to win10, but there is no such option. :-)
Comment 6 users 2015-10-28 14:43:02 UTC
Changes related to this bug have been committed.
Please check latest Git and update the bug accordingly.
You can also get the patch from:
http://git.claws-mail.org/

++ ChangeLog	2015-10-28 14:43:02.754394415 +0100
http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=6760d6392bae6e54dd936ce6b874318a307d93e8
Merge: 017df26 84aca59
Author: Colin Leroy <colin@colino.net>
Date:   Wed Oct 28 14:43:02 2015 +0100

    Merge branch 'master' of file:///home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=84aca59b3633ca717d42805268ecae3310a7541d
Author: Andrej Kacian <andrej@kacian.sk>
Date:   Wed Oct 28 14:40:28 2015 +0100

    Convert filename to UTF-16 before passing it to ShellExecute().
    
    Closes bug #3454 (Windows).

Note You need to log in before you can comment on or make changes to this bug.