help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Decode the octets with hexadecimal values.


From: Hongyi Zhao
Subject: Re: Decode the octets with hexadecimal values.
Date: Sat, 20 May 2023 19:01:29 +0800

On Sat, May 20, 2023 at 6:53 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>
> On Sat, May 20, 2023 at 5:45 PM Eli Zaretskii <eliz@gnu.org> wrote:
> >
> > > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > > Date: Sat, 20 May 2023 16:51:19 +0800
> > > Cc: help-gnu-emacs@gnu.org
> > >
> > > On Sat, May 20, 2023 at 4:18 PM Eli Zaretskii <eliz@gnu.org> wrote:
> > > >
> > > > > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > > > > Date: Sat, 20 May 2023 15:37:42 +0800
> > > > > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> > > > >
> > > > > But Emacs is also extremely powerful, I expect someone here can give
> > > > > an Emacs-based solution.
> > > >
> > > > We have quoted-printable-decode-region.
> > >
> > > But the result will be the one shown in the attached screenshot.
> >
> > By default, the result is a unibyte string, you need to decode it to
> > get readable text:
> >
> >   (quoted-printable-decode-region FROM TO 'utf-8)
> >
> > (Do you read the doc strings of the functions before you use them?  If
> > not, you should: that's what they are there for.)
>
> Thank you for your valuable hints. The following steps do the trick:
>
> 1. C-x RET c utf-8-unix RET
> 2. Select/mark/highlight the text in question, and then
> M-x quoted-printable-decode-region RET

But by comparing the results of Python and Emacs, we can see that
there are three redundant underscores in the latter, as shown in the
attached screenshot. Any tips for this behavior?

> Best,
> Zhao

Attachment: image.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]