Summary: | Unable to insert a file into a message during compose. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Claws Mail (GTK 2) | Reporter: | Marvin <marvint.roebuck> | ||||||
Component: | UI/Compose Window | Assignee: | users | ||||||
Status: | RESOLVED WORKSFORME | ||||||||
Severity: | normal | ||||||||
Priority: | P3 | ||||||||
Version: | 3.11.1 | ||||||||
Hardware: | PC | ||||||||
OS: | Linux | ||||||||
Attachments: |
|
Description
Marvin
2014-12-09 19:28:44 UTC
Works for me. Please attach a file to this bug report that exhibits this behaviour. The file is a text file. file file.txt tells me: Non-ISO extended-ASCII text Size in bytes: 252907 (In reply to comment #2) > The file is a text file. > > file file.txt tells me: > > Non-ISO extended-ASCII text > > > Size in bytes: 252907 Can you attach it? Nah, but look, I see these in the file: http://unicode-table.com/en/search/?q=224 and http://unicode-table.com/en/search/?q=233 and http://unicode-table.com/en/search/?q=228 And more like that. What about inserting file downloaded from http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt ? Does that work? I can include that UTF8-demo file with no problems. file UTF-8-demo.txt UTF-8-demo.txt: UTF-8 Unicode text file -i UTF-8-demo.txt UTF-8-demo.txt: text/plain; charset=utf-8 and for the problem file file -i file.txt text/plain; charset=unknown-8bit Well, if you do not want to attach a file you are having a problem with, then I don't think we can help you. I was not able to reproduce this no matter what I tried. Feel free to reopen this bug once you decide to provide a file to reproduce the issue with. Created attachment 1458 [details]
Problem file with unicode char that causes claws to raise an assert
This is the char that causes claws to raise an assert. http://unicode-table.com/en/search/?q=146 (In reply to comment #9) > This is the char that causes claws to raise an assert. > > http://unicode-table.com/en/search/?q=146 ╭──────────────────────────────────────────────────────────────── │$ wget -q -O tst 'http://www.thewildbeast.co.uk/claws-mail/bugzilla/attachment.cgi?id=1458' │$ iconv -f UTF-8 tst │ │ │iconv: illegal input sequence at position 2 ╰──────────────────────────────────────────────────────────────── Sorry, but that file doesn't seem a valid UTF-8 encoded one. Thinking as you all do again, it ain't easy, seems to be a documentation problem. "When inserting a file into a current message via Ctrl-I or via the menu during compose Message->Insert file, claws uses the file extension to correctly or incorrectly determine the file type and decide what kind of file we're inserting. If claws is unable to determine the file type it will fail, going silent, but will raise an assert to stdout, so go look for stdout output your self. You may also scratch your head if that's what you want to do." There seems to be some code already around checking what gets inserted. When trying a larger file a warning window pops-up to say something like "Are you sure you want to include a file that's this large?"* Doesn't seem like a huge leap to add a check for a file-type mismatch. For example including a text file that is not, based upon what claws considers to be text, which is unclear and seems to be a narrow definition. Maybe the definition of what claws considers to be text could also be displayed so the user knows more about what happened and might have a chance to fix the text file that claws doesn't like. Or offer a suggestion of attaching the file instead. * I don't recall what size it showed in the size-warning pop-up, there's much inconsistency throughout claws on reporting on the size of things. Created attachment 1460 [details]
Improve user feedback in this case
The proposed patch ensures the returned UTF-8 is valid one and warns the user if it's not possible to insert the file because of failed code conversion.
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 2014-12-17 17:10:02.557606222 +0100 http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=da6173fe104763f38293b3346d9b07d44ea1e6b2 Merge: 87be2c0 ff2f663 Author: Colin Leroy <colin@colino.net> Date: Wed Dec 17 17:10:02 2014 +0100 Merge branch 'master' of file:///home/git/claws http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=ff2f663ebca80be4991c71be724d5a29ef5a3bdf Author: Ricardo Mones <ricardo@mones.org> Date: Wed Dec 17 16:45:12 2014 +0100 Improve feedback to user when bug #3349 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 2014-12-19 16:26:02.609610050 +0100 http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=cb2051d55440b75e9cbecb408a1a16e9bc82634b Merge: 839e527 2fc36b1 Author: Colin Leroy <colin@colino.net> Date: Fri Dec 19 16:26:02 2014 +0100 Merge branch 'master' of file:///home/git/claws http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=2fc36b1cd471c4b3e11e5099a85a42415395de01 Author: Colin Leroy <colin@colino.net> Date: Fri Dec 19 16:23:00 2014 +0100 Better fix for bug #3349 (almost all the needed code was there :-) |