mirror of
https://github.com/djcb/mu.git
synced 2024-06-27 07:35:16 +02:00
297df938d6
Improve the function ``cleanup_filename()`` of ``lib/mu-msg-part.c`` to use Unicode characters when replacing the control characters, slashes and colons with ``-``. Originally, this function just use plain C characters (i.e., assuming ASCII string) when checking each character is or not a control character, slash or colon. However, when the attachment filename contains non-ASCII (e.g., Chinese characters), all the non-ASCII characters are replaced with ``-``. For example: * Before: ``` > mu view test_chinese_attachment_filename.eml From: Tester <tester@example.com> To: Example <example@example.com> Subject: Test email with attachment of Chinese filename Date: Mon 23 May 2016 05:22:09 PM CST Attachments: 'attachment-test.txt', '------------.txt', '-------test.txt' Hello, This is a simple test email with three attachments: 1. `attachment:test.txt`: filename is all English; 2. `测试附件.txt`: filename is all Chinese (exclude the extension); 3. `附件-test.txt`: filename mixes Chinese and English. ``` * After: ``` > ./build/mu/mu/mu view test_chinese_attachment_filename.eml From: Tester <tester@example.com> To: Example <example@example.com> Subject: Test email with attachment of Chinese filename Date: Mon 23 May 2016 05:22:09 PM CST Attachments: 'attachment-test.txt', '测试附件.txt', '附件-test.txt' Hello, This is a simple test email with three attachments: 1. `attachment:test.txt`: filename is all English; 2. `测试附件.txt`: filename is all Chinese (exclude the extension); 3. `附件-test.txt`: filename mixes Chinese and English. ``` |
||
---|---|---|
.. | ||
tests | ||
doxyfile.in | ||
Makefile.am | ||
mu-bookmarks.c | ||
mu-bookmarks.h | ||
mu-contacts.c | ||
mu-contacts.h | ||
mu-container.c | ||
mu-container.h | ||
mu-date.c | ||
mu-date.h | ||
mu-flags.c | ||
mu-flags.h | ||
mu-index.c | ||
mu-index.h | ||
mu-log.c | ||
mu-log.h | ||
mu-maildir.c | ||
mu-maildir.h | ||
mu-msg-crypto.c | ||
mu-msg-doc.cc | ||
mu-msg-doc.h | ||
mu-msg-fields.c | ||
mu-msg-fields.h | ||
mu-msg-file.c | ||
mu-msg-file.h | ||
mu-msg-iter.cc | ||
mu-msg-iter.h | ||
mu-msg-part.c | ||
mu-msg-part.h | ||
mu-msg-prio.c | ||
mu-msg-prio.h | ||
mu-msg-priv.h | ||
mu-msg-sexp.c | ||
mu-msg.c | ||
mu-msg.h | ||
mu-query.cc | ||
mu-query.h | ||
mu-runtime.c | ||
mu-runtime.h | ||
mu-script.c | ||
mu-script.h | ||
mu-store-priv.hh | ||
mu-store-read.cc | ||
mu-store-write.cc | ||
mu-store.cc | ||
mu-store.h | ||
mu-str.c | ||
mu-str.h | ||
mu-threader.c | ||
mu-threader.h | ||
mu-util.c | ||
mu-util.h |