GNU bug report logs - #73846
[PATCH] Make djvused emit UTF-8 encoded text

Previous Next

Package: emacs;

Reported by: Visuwesh <visuweshm <at> gmail.com>

Date: Thu, 17 Oct 2024 04:16:02 UTC

Severity: normal

Tags: patch

Done: Tassilo Horn <tsdh <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 73846 in the body.
You can then email your comments to 73846 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to tsdh <at> gnu.org, bug-gnu-emacs <at> gnu.org:
bug#73846; Package emacs. (Thu, 17 Oct 2024 04:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Visuwesh <visuweshm <at> gmail.com>:
New bug report received and forwarded. Copy sent to tsdh <at> gnu.org, bug-gnu-emacs <at> gnu.org. (Thu, 17 Oct 2024 04:16:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Make djvused emit UTF-8 encoded text
Date: Thu, 17 Oct 2024 09:42:30 +0530
[Message part 1 (text/plain, inline)]
Tags: patch

Hi Tassilo,

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.


In GNU Emacs 31.0.50 (build 13, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.18.0, Xaw scroll bars) of 2024-10-06 built on astatine
Repository revision: 500f5da5fb62cd0bbded8df754d93e3147d1d847
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101011
System Description: Debian GNU/Linux trixie/sid

Configured using:
 'configure --with-sound=alsa --with-x-toolkit=lucid --without-xaw3d
 --without-gconf --without-libsystemd --with-cairo CFLAGS=-g3'
[0001-Make-djvused-emit-UTF-8-encoded-text.patch (text/patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73846; Package emacs. (Thu, 17 Oct 2024 05:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 73846 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: tsdh <at> gnu.org, 73846 <at> debbugs.gnu.org
Subject: Re: bug#73846: [PATCH] Make djvused emit UTF-8 encoded text
Date: Thu, 17 Oct 2024 08:26:27 +0300
> Cc: "Tassilo Horn" <tsdh <at> gnu.org>
> From: Visuwesh <visuweshm <at> gmail.com>
> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73846; Package emacs. (Thu, 17 Oct 2024 08:34:02 GMT) Full text and rfc822 format available.

Message #11 received at 73846 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tsdh <at> gnu.org, 73846 <at> debbugs.gnu.org
Subject: Re: bug#73846: [PATCH] Make djvused emit UTF-8 encoded text
Date: Thu, 17 Oct 2024 14:01:56 +0530
[Message part 1 (text/plain, inline)]
[வியாழன் அக்டோபர் 17, 2024] Eli Zaretskii wrote:

>> Cc: "Tassilo Horn" <tsdh <at> gnu.org>
>> From: Visuwesh <visuweshm <at> gmail.com>
>> 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.

My locale is a UTF-8 one indeed.  I've now let bound
coding-system-for-read around everything inside with-temp-buffer.

> Please also add a comment there explaining what the -u switch does and
> why we use it there.

Done in attached patch, I hope it is clear.

> Thanks.

[0001-Make-djvused-emit-UTF-8-encoded-text.patch (text/x-diff, attachment)]

Reply sent to Tassilo Horn <tsdh <at> gnu.org>:
You have taken responsibility. (Fri, 18 Oct 2024 06:09:02 GMT) Full text and rfc822 format available.

Notification sent to Visuwesh <visuweshm <at> gmail.com>:
bug acknowledged by developer. (Fri, 18 Oct 2024 06:09:02 GMT) Full text and rfc822 format available.

Message #16 received at 73846-done <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: 73846-done <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#73846: [PATCH] Make djvused emit UTF-8 encoded text
Date: Fri, 18 Oct 2024 08:07:51 +0200
Visuwesh <visuweshm <at> gmail.com> writes:

>> Please also add a comment there explaining what the -u switch does
>> and why we use it there.
>
> Done in attached patch, I hope it is clear.

It is.  Applied and pushed to master.

Thanks again,
  Tassilo




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 15 Nov 2024 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 213 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.