From: lacsaP Patatetom <patatetom@gmail.com>
To: "Pádraig Brady" <P@draigbrady.com>
Cc: 69488@debbugs.gnu.org
Subject: bug#69488: tr (question)
Date: Mon, 4 Mar 2024 09:25:24 +0100 [thread overview]
Message-ID: <CAGhAadc2gN+e5GbiZKD7w-xs5Sxk_Cppqy4WdxpjjuTrVL9XYw@mail.gmail.com> (raw)
In-Reply-To: <4c63daa4-10f9-1a35-2da4-628c7cc88ac7@draigBrady.com>
Le ven. 1 mars 2024 à 20:30, Pádraig Brady <P@draigbrady.com> a écrit :
> On 01/03/2024 15:33, lacsaP Patatetom wrote:
> > hi,
> >
> > I did a few tests with tr and I'm surprised by the results...
> >
> > $ echo éèçà
> > éèçà
> >
> > these characters are encoded in utf-8 on 2 bytes :
> >
> > $ echo éèçà | xxd
> > 00000000: c3a9 c3a8 c3a7 c3a0 0a .........
> >
> > now I use tr to remove non-printable characters :
> >
> > $ echo éèçà | tr -cd '[:print:]'
> > $ echo éèçà | tr -cd '[:print:]' | wc
> > 0 0 0
> >
> > all characters are deleted by tr
> > now I want to keep the "é" character :
> >
> > $ echo éèçà | tr -cd '[:print:]é'
> > ��
> >
> > why do the "�" characters appear ?
> >
> > regards, lacsaP.
>
>
> It's a known issue that tr is currently non multi-byte aware.
>
> thanks,
> Pádraig
>
hi,
thank you for this clarification.
what alternative to `tr` would you recommend for this type of treatment ?
regards, lacsaP.
prev parent reply other threads:[~2024-03-04 8:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAGhAadeFkAzKdFxL4L-SKartjOAKsOW1nKY0gokEquJGBsMwpw@mail.gmail.com>
2024-03-01 19:30 ` bug#69488: tr (question) Pádraig Brady
2024-03-04 8:25 ` lacsaP Patatetom [this message]
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
List information: https://lists.gnu.org/mailman/listinfo/bug-coreutils
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGhAadc2gN+e5GbiZKD7w-xs5Sxk_Cppqy4WdxpjjuTrVL9XYw@mail.gmail.com \
--to=patatetom@gmail.com \
--cc=69488@debbugs.gnu.org \
--cc=P@draigbrady.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).