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 [192.168.1.2] (unknown [101.128.125.123]) by gnuweeb.org (Postfix) with ESMTPSA id 92D8F7E254; Wed, 19 Oct 2022 17:23:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666200236; bh=MqizHmzY+KLka66NFHXUKyYVOrSRZ3Xrs86Qpw2C5Hs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=jUrcRw0DXFbQfu33sqzp+WmOxL2i0Yvg03bNv70hkZtPM/xk+d4dugqO+/u7DRMwq gZbRjTtg9ALW+0+r6SxwbQyy21GUNlXN/hqcehNMClFEQplvHdD7wBsiHotL06CFZ4 f7ZuaPAzROMktQpoUE9IgI5a0EyFx9LI6E4Mq6EA2w2nGoDEwijjgbJZlUORbEAivw yepyqB4380VPUaa1EfHJhuGJ+JYhz6bckI5nuTDmadmw9IOmSca1YEI7Jl/iKB+YE8 8NWd2tqLPnG0BUAozw9SZK4M5T2Nklay4AvvaTMd4nCcsZyQyd/A6jw0w81Gxr5/PJ 9Mxe5FRgGwvuw== Message-ID: <8612169c-4b93-4557-23ab-9030e02a87b2@gnuweeb.org> Date: Thu, 20 Oct 2022 00:23:53 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v1 6/7] atom: add manage_payload() Content-Language: en-US To: Ammar Faizi 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> From: Muhammad Rizki In-Reply-To: <561e1fe5-469c-53ba-2c97-35605307e2fb@gnuweeb.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: 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.