all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Decode the octets with hexadecimal values.
Date: Sat, 20 May 2023 19:01:29 +0800	[thread overview]
Message-ID: <CAGP6POKAdetwL=rrV=LoYVNDHQJamvL23zEEKhReDTazCRP9Ew@mail.gmail.com> (raw)
In-Reply-To: <CAGP6POLyB8u46--GUqVMJTNB-sE_Tk0ZUZv+r9TyACvnZj+4UA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1518 bytes --]

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 #2: image.png --]
[-- Type: image/png, Size: 266292 bytes --]

  reply	other threads:[~2023-05-20 11:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-20  6:55 Decode the octets with hexadecimal values Hongyi Zhao
2023-05-20  7:04 ` Platon Pronko
2023-05-20  7:37   ` Hongyi Zhao
2023-05-20  8:18     ` Eli Zaretskii
2023-05-20  8:51       ` Hongyi Zhao
2023-05-20  9:44         ` Eli Zaretskii
2023-05-20 10:53           ` Hongyi Zhao
2023-05-20 11:01             ` Hongyi Zhao [this message]
2023-05-20 12:37               ` Eli Zaretskii
2023-05-20 13:47                 ` Hongyi Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGP6POKAdetwL=rrV=LoYVNDHQJamvL23zEEKhReDTazCRP9Ew@mail.gmail.com' \
    --to=hongyi.zhao@gmail.com \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.