Subject: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings

From: Eli Zaretskii <[email-masked]>
Date: Thu, 06 May 2021 18:26:48 +0300

> From: Stefan Monnier <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  [email-masked]
> Date: Thu, 06 May 2021 09:27:38 -0400
> 
> That's not sufficient, because if we don't decode the file before we
> call `package-buffer-info` (from `package-install-from-buffer`), then
> the <foo>-pkg.el file will have incorrect content (e.g. the non-ASCII
> chars in the description of the package, will be later incorrectly
> displayed in `list-packages`).

So you are saying the description of the package needs to be decoded
before using it for list-packages?  That'd be okay; all I care about
is that the decoded stuff does NOT replace the original raw bytes, but
instead is used only where decoding is needed.  IOW, decoding should
either be done on substrings of the original file, and the result
stored in strings, or the decoded stuff should be placed in a separate
scratch buffer, which will be used only where decoding is really
needed.