Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII

Liste des GroupesRevenir à cu shell 
Sujet : Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII
De : nunojsilva (at) *nospam* invalid.invalid (Nuno Silva)
Groupes : comp.unix.shell
Date : 12. May 2025, 14:18:24
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vvssf0$13ls6$1@dont-email.me>
References : 1 2 3
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
On 2025-05-12, Kenny McCormack wrote:

In article <slrn1023i84.2s2es.cmartin+usenetYYMMDD@nyx2.nyx.net>,
Chuck Martin  <cmartin+usenetYYMMDD@nyx.net> wrote:
...
Try piping it into the following command:
>
perl -CS -MEncode -ne 'print decode("MIME-Header", $_)'
>
Bingo!  Thanks very much.
>
That worked well on the other example I gave in the OP too (which was
actually more the focus of my query).
>
I still get the binary glop in place of the single quotes (The text
contains the word "They're", rendered as "They<binaryglop>re").  Note that
in the input string, <binaryglop> is (the literal string): =E2=80=99
which gets converted by your Perl program into the 3
characters with octal codes (as displayed by "od -bc"): 342 200 231
>
I can deal with this later problem myself via brute force with AWK, but it
would be nice if I didn't have to - i.e., if there were a complete solution
(i.e., one that does also the other half of the job).

My guess is that this isn't an apostrophe, but a "right single quotation
mark", which is sadly a common sight in such a context, and Emacs tells
me that this (UCS codepoint 0x2019) is represented as E2 80 99 in UTF-8.

Are there good ways to convert such chars to something more reasonable?
The only thing that occurs to me right now is passing it through iconv
to a more limited charset using transliteration (e.g. "iconv -f utf8 -t
iso8859-1//TRANSLIT -c") and then back to the desired encoding and
charset.

(But I suppose if this is already involving perl, then perhaps such a
modification can be done through perl too.)

--
Nuno Silva

Date Sujet#  Auteur
4 May 25 * How to convert <binaryGlowMixedWithASCII> to pure ASCII25Kenny McCormack
4 May 25 +* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII6Lew Pitcher
4 May 25 i+* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII3Kenny McCormack
4 May 25 ii`* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII2John-Paul Stewart
4 May 25 ii `- Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII1Kenny McCormack
5 May 25 i`* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII2Eli the Bearded
5 May 25 i `- Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII1Janis Papanagnou
12 May 25 `* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII18Chuck Martin
12 May 25  `* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII17Kenny McCormack
12 May 25   `* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII16Nuno Silva
12 May 25    +* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII14Kenny McCormack
12 May 25    i`* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII13Chris Elvidge
14 May 25    i `* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII12Brian Patrie
14 May 25    i  `* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII11Chris Elvidge
14 May 25    i   `* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII10Kaz Kylheku
14 May 25    i    +* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII7Janis Papanagnou
15 May 25    i    i`* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII6Alexis
15 May 25    i    i +- Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII1Janis Papanagnou
21 May 25    i    i `* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII4Lars Poulsen
22 May 25    i    i  `* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII3Lawrence D'Oliveiro
22 May 25    i    i   +- Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII1Kaz Kylheku
22 May 25    i    i   `- Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII1Keith Thompson
15 May 25    i    +- Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII1Brian Patrie
15 May 25    i    `- Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII1Geoff Clare
12 May 25    `- Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII1Eli the Bearded

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal