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.14] (unknown [182.253.88.229]) by gnuweeb.org (Postfix) with ESMTPSA id ED195814C5; Mon, 7 Nov 2022 01:01:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1667782886; bh=BXZb4DycqSjpJGIdkaqJvQkbLNLTl+akKlR2Tu8VztA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=OdVMymKiecK08sKVO3kivV8N3fkRlyxq4/5SF521c6lS73ZgTZo8ncrL3YSMd2QCi xDVQ1+Kz/2EduJt+YoYe4tv9I0lHN6MtghCwi3eBVFGadXUIwv+/8bN1P5+bwEP6mk 4LV3LbESb+kleEy4/kXWdT8tsJeID/VMopfhTrZSucvT5zxPwYHqfAwEI5soBBE6WX NJ3RhY7QV6QQoHKV3Ge14RVp22rWqzVYtssvJ+uDvO/Ym2Y8+ay4Oaxw9OpYaa+UUH tPOdKr6+Oazx8j6b+rABb79F3kyhUaVXhS4u1OEHHHrRZZ7RQO4tfhdxjvAdcV90LC 1oaqUrftugq7Q== Message-ID: <73b917bc-6d20-b2d1-f956-11d6e2ff1662@gnuweeb.org> Date: Mon, 7 Nov 2022 08:01:22 +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 05/16] utils: Improve fix_utf8_char() Content-Language: en-US To: Muhammad Rizki Cc: Alviro Iskandar Setiawan , GNU/Weeb Mailing List References: <20221104180931.3852-1-kiizuha@gnuweeb.org> <20221104180931.3852-6-kiizuha@gnuweeb.org> From: Ammar Faizi In-Reply-To: <20221104180931.3852-6-kiizuha@gnuweeb.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: On 11/5/22 1:09 AM, Muhammad Rizki wrote: > --- a/daemon/atom/utils.py > +++ b/daemon/atom/utils.py > @@ -263,8 +263,8 @@ def remove_patch(tmp: Union[str, list]): > def fix_utf8_char(text: str, html_escape: bool = True): > t = text.rstrip().replace("�"," ") > if html_escape: > - t = html.escape(html.escape(text)) > - return t > + return html.escape(html.escape(text)) > + return html.unescape(t) Can you explain why we need to do the following: html.escape(html.escape(text)) Why does it have to be escaped twice? I still don't understand the reason behind this mess since the beginning. -- Ammar Faizi