public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
From: Olivier Gayot <olivier.gayot@canonical.com>
To: Ben Hutchings <ben@decadent.org.uk>,
	Ming Lei <ming.lei@redhat.com>, Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org
Cc: linux-efi@vger.kernel.org, Mulhern <amulhern@redhat.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	stable@vger.kernel.org
Subject: Re: [PATCH V3] block: fix conversion of GPT partition name to 7-bit
Date: Fri, 28 Mar 2025 10:29:38 +0100	[thread overview]
Message-ID: <7afc3a7e-1dd8-4dbb-b243-75bd554c00da@canonical.com> (raw)
In-Reply-To: <3fa05bba190bec01df2bc117cf7e3e2f00e8b946.camel@decadent.org.uk>

> We shouldn't mask the input character; instead we should do a range
> check before calling isprint().  Something like:
> 
> 	u16 uc = le16_to_cpu(in[i]);
> 	u8 c;
> 
> 	if (uc < 0x80 && (uc == 0 || isprint(uc)))
> 		c = uc;
> 	else
> 		c = '!';

Sounds like a good alternative to me.

Would a conversion from utf-16-le to utf-8 be a viable solution?

  reply	other threads:[~2025-03-28  9:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-05  2:21 [PATCH V3] block: fix conversion of GPT partition name to 7-bit Ming Lei
2025-03-05 14:45 ` Jens Axboe
2025-03-27 22:34 ` Ben Hutchings
2025-03-28  9:29   ` Olivier Gayot [this message]
2025-03-28 18:03     ` Ben Hutchings
2025-03-28 19:57   ` David Laight

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=7afc3a7e-1dd8-4dbb-b243-75bd554c00da@canonical.com \
    --to=olivier.gayot@canonical.com \
    --cc=amulhern@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=ben@decadent.org.uk \
    --cc=dave@stgolabs.net \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=stable@vger.kernel.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox