From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [10.7.7.5] (unknown [182.253.183.247]) by gnuweeb.org (Postfix) with ESMTPSA id 8ACCE804D1; Fri, 21 Oct 2022 07:04:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666335845; bh=X0UV0cO52X6X2ia+cbyKGA91rMBl0JuVxFDgu+q+hf0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=i21vCl7GddonZ0B7i8e4b/c8HDbZhB8R+GdtMxYgslrqEAZRY3x4OvM0fpAMO94Us aMlTgewr3yt6nE+vvNEl5AHNo0QvBzLdcXIbikW9iksMl8pY4iIcQw8gdfcYROlFlm +dq7Hzrtw5OWn3Hbg2TrO7HC0Ks60TVw4mLDwid9WBBUtYn4N+uk4X+JqNqUgmUkMq O1fFHh2Whu9AHorK6/TQMKjLYOyZRHYrS9ddM3X7bNmqxX6B/E8Heud9P+mp5P0Aza Q3YlqW07lQN+BGXE0djmwD/pO8O5qCm7scJ1b8R8eiXzv+prmzEwcy0F73yx5E3rc/ DbqsJ8MPY6tRA== Message-ID: Date: Fri, 21 Oct 2022 14:04:02 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v1 6/7] atom: add manage_payload() Content-Language: en-US To: Muhammad Rizki Cc: Alviro Iskandar Setiawan , GNU/Weeb Mailing List References: <20221018081635.1617-1-kiizuha@gnuweeb.org> <20221018081635.1617-7-kiizuha@gnuweeb.org> <561e1fe5-469c-53ba-2c97-35605307e2fb@gnuweeb.org> <8612169c-4b93-4557-23ab-9030e02a87b2@gnuweeb.org> From: Ammar Faizi In-Reply-To: <8612169c-4b93-4557-23ab-9030e02a87b2@gnuweeb.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: On 10/20/22 12:23 AM, Muhammad Rizki wrote: > On 20/10/2022 00.04, Ammar Faizi wrote: >> On 10/18/22 3:16 PM, Muhammad Rizki wrote: >>> +def manage_payload(payload: Message): >>> +    p = str(payload.get_payload()) >>> +    tf_encode = payload.get("Content-Transfer-Encoding") >>> +    if tf_encode != "base64": >>> +        return p.encode().decode("utf-8", errors="replace") >>> +    return b64decode(p).decode("utf-8") >> >> What happen if we have "Content-Transfer-Encoding: quoted-printable"? >> Does this decode it properly? >> >> Example: https://lore.kernel.org/io-uring/20220908002616.3189675-1-shr@fb.com/raw >> > > Yes, it does normally. It really *does not*, please try and see the output yourself. The email sent to Telegram is not decoded. -- Ammar Faizi