GNU bug report logs - #40519
28.0.50; decode-coding-string fails EOL conversion of ASCII string

Previous Next

Package: emacs;

Reported by: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>

Date: Thu, 9 Apr 2020 08:27:02 UTC

Severity: normal

Found in version 28.0.50

Done: Mattias Engdegård <mattiase <at> acm.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 40519 in the body.
You can then email your comments to 40519 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 bug-gnu-emacs <at> gnu.org:
bug#40519; Package emacs. (Thu, 09 Apr 2020 08:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 09 Apr 2020 08:27:02 GMT) Full text and rfc822 format available.

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

From: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; decode-coding-string fails EOL conversion of ASCII string
Date: Thu, 09 Apr 2020 17:26:05 +0900
Since commit 4ed39549e3f9dbfeb2aea0e2674a7701dbc0e5ea (Avoid expensive
recoding for ASCII identity cases (bug#40407)), below code returns
unexpected result.

(let ((string "ABCD\x0d\nEFG")
      inhibit-eol-conversion)
  (decode-coding-string string 'raw-text-dos))

-> "ABCD^M
EFG"

expected result is 
-> "ABCD
EFG"

It seems that the committed code does not take care of EOL conversion.

-- 
Kazuhiro Ito




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40519; Package emacs. (Thu, 09 Apr 2020 09:24:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
Cc: 40519 <at> debbugs.gnu.org
Subject: Re: bug#40519: 28.0.50;
 decode-coding-string fails EOL conversion of ASCII string
Date: Thu, 09 Apr 2020 12:22:57 +0300
> Date: Thu, 09 Apr 2020 17:26:05 +0900
> From: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
> 
> Since commit 4ed39549e3f9dbfeb2aea0e2674a7701dbc0e5ea (Avoid expensive
> recoding for ASCII identity cases (bug#40407)), below code returns
> unexpected result.
> 
> (let ((string "ABCD\x0d\nEFG")
>       inhibit-eol-conversion)
>   (decode-coding-string string 'raw-text-dos))
> 
> -> "ABCD^M
> EFG"
> 
> expected result is 
> -> "ABCD
> EFG"
> 
> It seems that the committed code does not take care of EOL conversion.

Thanks, I hope I fixed this now.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40519; Package emacs. (Thu, 09 Apr 2020 10:49:01 GMT) Full text and rfc822 format available.

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

From: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 40519 <at> debbugs.gnu.org
Subject: Re: bug#40519: 28.0.50;
 decode-coding-string fails EOL conversion of ASCII string
Date: Thu, 09 Apr 2020 19:48:36 +0900
> > Since commit 4ed39549e3f9dbfeb2aea0e2674a7701dbc0e5ea (Avoid expensive
> > recoding for ASCII identity cases (bug#40407)), below code returns
> > unexpected result.
> > 
> > (let ((string "ABCD\x0d\nEFG")
> >       inhibit-eol-conversion)
> >   (decode-coding-string string 'raw-text-dos))
> > 
> > -> "ABCD^M
> > EFG"
> > 
> > expected result is 
> > -> "ABCD
> > EFG"
> > 
> > It seems that the committed code does not take care of EOL conversion.
> 
> Thanks, I hope I fixed this now.

Thank you.  But there is still a problem in encode-coding-string.

(let ((string "ABCD\nEFG")
      inhibit-eol-conversion)
  (list
   (encode-coding-string string 'raw-text-dos)
   (encode-coding-string string 'raw-text-mac)))

-> ("ABCD
EFG" "ABCD
EFG")

-- 
Kazuhiro Ito




Reply sent to Mattias Engdegård <mattiase <at> acm.org>:
You have taken responsibility. (Thu, 16 Apr 2020 10:45:02 GMT) Full text and rfc822 format available.

Notification sent to Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>:
bug acknowledged by developer. (Thu, 16 Apr 2020 10:45:02 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattiase <at> acm.org>
To: 40519-done <at> debbugs.gnu.org
Cc: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
Subject: Re: bug#40519: 28.0.50; decode-coding-string fails EOL conversion of
 ASCII string
Date: Thu, 16 Apr 2020 12:44:06 +0200
This was fixed as part of bug#40407 (e18c24b35a).





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 14 May 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 121 days ago.

Previous Next


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