From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#73846: [PATCH] Make djvused emit UTF-8 encoded text Date: Thu, 17 Oct 2024 08:26:27 +0300 Message-ID: <86frovpaf0.fsf@gnu.org> References: <87y12n1i6p.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33829"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tsdh@gnu.org, 73846@debbugs.gnu.org To: Visuwesh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 17 07:27:05 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t1J2O-0008ZE-DJ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Oct 2024 07:27:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t1J24-0000lG-9j; Thu, 17 Oct 2024 01:26:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t1J22-0000l0-M5 for bug-gnu-emacs@gnu.org; Thu, 17 Oct 2024 01:26:42 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t1J22-0004Lc-Cl for bug-gnu-emacs@gnu.org; Thu, 17 Oct 2024 01:26:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=wTEcbB599vwfW2kYOXweybxCq56lhFjV/gkT9TM8jc8=; b=XD1i/CypAetwy/gZeNjdEkaMCV0wK0uWCxdTKL0e5Ioo6KBa+GlN8QgAkgYs28BaT2jh4C3ne0LlEYo5KBoTfi/2PxVEI+aIQDvDw1Jt4OdxGkfE2F0MA6lYvfTBmyV5ubp9/socJFzxN3erCed3v/sahJF1keBL6XyT1ytnNnHPsWvPAp7NgsAlpbYBiJwQSHvMP608IroYhHhzSmd0HwtF9sJTYFV4V0f4AVu7iXkoaIXWrzpQ0X9RoICTlqSVFxxe844HH58l0HVKAIm014eMJNTlKB6EhPUKyzZNzF3vl6Zfc5hQqSH/MdRTIJs0mMVlNut3mIpXnVPM56oeWA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t1J2M-00032s-G9 for bug-gnu-emacs@gnu.org; Thu, 17 Oct 2024 01:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Oct 2024 05:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73846 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73846-submit@debbugs.gnu.org id=B73846.172914282011696 (code B ref 73846); Thu, 17 Oct 2024 05:27:02 +0000 Original-Received: (at 73846) by debbugs.gnu.org; 17 Oct 2024 05:27:00 +0000 Original-Received: from localhost ([127.0.0.1]:33053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1J2K-00032Z-Dp for submit@debbugs.gnu.org; Thu, 17 Oct 2024 01:27:00 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57478) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1J2H-00032J-Or for 73846@debbugs.gnu.org; Thu, 17 Oct 2024 01:26:58 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t1J1r-0004I4-UP; Thu, 17 Oct 2024 01:26:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=wTEcbB599vwfW2kYOXweybxCq56lhFjV/gkT9TM8jc8=; b=Qipla0V7uBEm dSAh3C1ViGn+jV0xTWU095d37H7Ohw3s8onZdUmOwGwUReTtbBSuYEHl6Aiwcb8oJ1yqH67UDp4zT G0hpDY+iyJimrWSTKF0mIJRHftnnEwrfQYPz1MAerHJFWpnxwiEbdnl6q4VTLCHnkuNfoq00RNHeh U77fgZwX0Nmonvrp2q/od1owa7vx95dRkn/gBQ4mCwkKcyIeV8BlxseisxMfhgLTwYstXw5Ps7Lt+ L9i/VTB9/lIEVseXyoPJGvCJOrnhYfv4R2Wq5kYwfWwICAwzVFxdIc3BoTqIpg2IlHUryrBw0yDD6 NCDcdJGNG9pHQI0JptKgig==; In-Reply-To: <87y12n1i6p.fsf@gmail.com> (message from Visuwesh on Thu, 17 Oct 2024 09:42:30 +0530) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:293704 Archived-At: > Cc: "Tassilo Horn" > From: Visuwesh > Date: Thu, 17 Oct 2024 09:42:30 +0530 > > This is a small patch to make djvused emit UTF-8 encoded text. In the > djvu test file that I sent you, outline in the appendix have non-ASCII > characters which are written as octal escapes. Rather than unescaping > them on Emacs side, we can request djvused to use UTF-8 directly which > this patch does. The attached patch does just that. If you force djvused to emit UTF-8 encoded text, you need to bind coding-system-for-read to 'utf-8, to make sure Emacs decodes that correctly. I'm guessing your locale uses UTF-8 by default, which is why it worked for you. Please also add a comment there explaining what the -u switch does and why we use it there. Thanks.