bug-coreutils@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: "Pádraig Brady" <P@draigBrady.com>
To: lacsaP Patatetom <patatetom@gmail.com>, 69488@debbugs.gnu.org
Subject: bug#69488: tr (question)
Date: Fri, 1 Mar 2024 19:30:33 +0000	[thread overview]
Message-ID: <4c63daa4-10f9-1a35-2da4-628c7cc88ac7@draigBrady.com> (raw)
In-Reply-To: <CAGhAadeFkAzKdFxL4L-SKartjOAKsOW1nKY0gokEquJGBsMwpw@mail.gmail.com>

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




       reply	other threads:[~2024-03-01 19:32 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 ` Pádraig Brady [this message]
2024-03-04  8:25   ` bug#69488: tr (question) lacsaP Patatetom

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=4c63daa4-10f9-1a35-2da4-628c7cc88ac7@draigBrady.com \
    --to=p@draigbrady.com \
    --cc=69488@debbugs.gnu.org \
    --cc=patatetom@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.
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).