From 3126ae30e949486ea39818c3571f5be8fc07f294 Mon Sep 17 00:00:00 2001 From: Ethan Glasser-Camp Date: Mon, 19 Nov 2012 13:02:55 +1900 Subject: [PATCH] Re: [BUG] Saving attachments containing UTF-8 chars --- 4f/c2076b9e4d9c58ca580062a26f3be254457ea6 | 90 +++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 4f/c2076b9e4d9c58ca580062a26f3be254457ea6 diff --git a/4f/c2076b9e4d9c58ca580062a26f3be254457ea6 b/4f/c2076b9e4d9c58ca580062a26f3be254457ea6 new file mode 100644 index 000000000..3ee24ecbf --- /dev/null +++ b/4f/c2076b9e4d9c58ca580062a26f3be254457ea6 @@ -0,0 +1,90 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id D38A9431FBF + for ; Sun, 18 Nov 2012 10:03:01 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id GjEcFIKrN8JQ for ; + Sun, 18 Nov 2012 10:03:01 -0800 (PST) +Received: from mail-qa0-f46.google.com (mail-qa0-f46.google.com + [209.85.216.46]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 0C502431FAF + for ; Sun, 18 Nov 2012 10:03:01 -0800 (PST) +Received: by mail-qa0-f46.google.com with SMTP id c11so5124579qad.5 + for ; Sun, 18 Nov 2012 10:02:59 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:subject:in-reply-to:references:user-agent:date:message-id + :mime-version:content-type; + bh=1XADBRoCphqtOiwxp6b7g2eC8G6KSxZyDq8JFv5tArE=; + b=z0tpuQiKvb8lxLYK9M+w0cE2o2PF9oZRnziVb0xeb/nGeOIC6HtdfByVZcBTrzq1vD + v/yA2b7iPtzc9kmZqBRSdWPCe/Wgz0n7Saulj5zcAYBG3km/rUM8C0zTutcLkTJ4OMso + wFAAITc8t2HBM+fCCq43y+3uy5dlgWIoqxQJXJEDkhxAwJQ6A9VklmOhA+YFcxDUqH6n + 8H8beJPE5abBo124ZypXAgipzH/biSmsnLqrnyXh7A5USJRZ7Slxr79hInEGvyQFac08 + Rmk9hCn3HkkMvE9DL/+3rEsZNqzveZAivWAltGIETR0OllOFxNHV9sTjXiJQi25+LQhX + H4Iw== +Received: by 10.224.78.148 with SMTP id l20mr9766424qak.27.1353261779189; + Sun, 18 Nov 2012 10:02:59 -0800 (PST) +Received: from smtp.gmail.com ([66.114.71.21]) + by mx.google.com with ESMTPS id em3sm4805880qab.12.2012.11.18.10.02.57 + (version=TLSv1/SSLv3 cipher=OTHER); + Sun, 18 Nov 2012 10:02:58 -0800 (PST) +From: Ethan Glasser-Camp +To: Ethan Glasser-Camp , + Tomi Ollila , + Michael Stapelberg , notmuch@notmuchmail.org +Subject: Re: [BUG] Saving attachments containing UTF-8 chars +In-Reply-To: <87zk2f1nt0.fsf@betacantrips.com> +References: + + <87zk2f1nt0.fsf@betacantrips.com> +User-Agent: Notmuch/0.14+45~g6ea9330 (http://notmuchmail.org) Emacs/24.1.1 + (x86_64-pc-linux-gnu) +Date: Sun, 18 Nov 2012 13:02:55 -0500 +Message-ID: <87txsm23hs.fsf@betacantrips.com> +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 18 Nov 2012 18:03:02 -0000 + +Ethan Glasser-Camp writes: + +> Writing this buffer using C-x C-w encodes it correctly too. So I think +> this is an emacs MIME problem. We call mm-save-part, which calls +> mm-save-part-to-file, which calls mm-with-unibyte-buffer. Hmm.. +> +> Indeed, it seems that inserting this character into a file that's been +> marked "unibyte" using (set-buffer-multibyte nil) turns it into the ^Y +> character (ASCII code 0x19 -- the character that comes out in the patch +> file). There's probably a technical reason that this should be true, but +> I can't think of why that would be. + +The more I think about this, the more convinced I become that this is a +bug in emacs's multibyte handling. I've filed a bug, see: + +http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12925 + +But I think Tomi's going to formalize his hacky patch and send that out +later too. When he does, it has my +1. + +Ethan -- 2.26.2