From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: Platon Pronko <platon7pronko@gmail.com>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: Decode the octets with hexadecimal values.
Date: Sat, 20 May 2023 15:37:42 +0800 [thread overview]
Message-ID: <CAGP6PO+Yc2gCY-J2HC52F3XSSTB+whHNzBoqcQ0usCo2-L0y=g@mail.gmail.com> (raw)
In-Reply-To: <c2004c79-cbd2-e261-8b70-fb2718b99254@gmail.com>
On Sat, May 20, 2023 at 3:04 PM Platon Pronko <platon7pronko@gmail.com> wrote:
>
> On 2023-05-20 14:55, Hongyi Zhao wrote:
> > Hi here,
> >
> > According to one of the comments here [1], I try to read the related
> > discussion here [2], but al.howardknight.net doesn't do any decoding
> > of the articles and I will see some non-human readable stuff, for
> > example:
> >
> > the shell first will do the same and then tell the kernel by means=20
> > of the system service =E2=80=9Cdup2=E2=80=9D to copy the contents of the en=
> > try #1 to=20
> > the entry #2.=C2=A0 Now two entries in the process' file descriptor=20
> > table=C2=A0=E2=80=93 #1 and #2=C2=A0=E2=80=93 refer to the opened file =E2=
> > =80=9Coutput.txt=E2=80=9D.
> >
> > So, I would like to know how to decode the octets with hexadecimal
> > values with the help of Emacs.
> >
> > [1] https://groups.google.com/g/comp.unix.shell/c/xXqxHrIchqg
> > [2] http://al.howardknight.net/?ID=165151671300
> >
> > Best,
> > Zhao
>
> Hi!
>
> That looks like quoted-printable encoding. I don't know how to decode that in Emacs,
> but here's an example of how you can do that in Python:
>
> import codecs
> s = """
> the shell first will do the same and then tell the kernel by means=20
> of the system service =E2=80=9Cdup2=E2=80=9D to copy the contents of the en=
> try #1 to=20
> the entry #2.=C2=A0 Now two entries in the process' file descriptor=20
> table=C2=A0=E2=80=93 #1 and #2=C2=A0=E2=80=93 refer to the opened file =E2=
> =80=9Coutput.txt=E2=80=9D.
> """
> print(codecs.decode(s.encode("utf8"), "QUOTED-PRINTABLE").decode("utf8").strip())
Yes. This works.
But Emacs is also extremely powerful, I expect someone here can give
an Emacs-based solution.
> --
> Best regards,
> Platon Pronko
> PGP 2A62D77A7A2CB94E
Regards,
Zhao
next prev parent reply other threads:[~2023-05-20 7:37 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 [this message]
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
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='CAGP6PO+Yc2gCY-J2HC52F3XSSTB+whHNzBoqcQ0usCo2-L0y=g@mail.gmail.com' \
--to=hongyi.zhao@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=platon7pronko@gmail.com \
/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.