linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Armin Wolf <W_Armin@gmx.de>
Cc: viro@zeniv.linux.org.uk, brauner@kernel.org, hansg@kernel.org,
	ilpo.jarvinen@linux.intel.com, superm1@kernel.org, jack@suse.cz,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v2 1/4] fs/nls: Fix utf16 to utf8 conversion
Date: Wed, 26 Nov 2025 16:18:46 +0100	[thread overview]
Message-ID: <aScaVgVAk_tH_v-w@black.igk.intel.com> (raw)
In-Reply-To: <20251111131125.3379-2-W_Armin@gmx.de>

On Tue, Nov 11, 2025 at 02:11:22PM +0100, Armin Wolf wrote:
> Currently the function responsible for converting between utf16 and
> utf8 strings will ignore any characters that cannot be converted. This
> however also includes multi-byte characters that do not fit into the
> provided string buffer.
> 
> This can cause problems if such a multi-byte character is followed by
> a single-byte character. In such a case the multi-byte character might
> be ignored when the provided string buffer is too small, but the
> single-byte character might fit and is thus still copied into the
> resulting string.
> 
> Fix this by stop filling the provided string buffer once a character
> does not fit. In order to be able to do this extend utf32_to_utf8()
> to return useful errno codes instead of -1.

Can you also update utf8_to_utf32() to return meaningful error codes?
Without that done we have inconsistent APIs.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-11-26 15:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-11 13:11 [PATCH v2 0/4] platform/x86: wmi: Prepare for future changes Armin Wolf
2025-11-11 13:11 ` [PATCH v2 1/4] fs/nls: Fix utf16 to utf8 conversion Armin Wolf
2025-11-26 15:18   ` Andy Shevchenko [this message]
2025-11-26 19:34     ` Armin Wolf
2025-11-11 13:11 ` [PATCH v2 2/4] platform/x86: wmi: Use correct type when populating ACPI objects Armin Wolf
2025-11-11 13:11 ` [PATCH v2 3/4] platform/x86: wmi: Remove extern keyword from prototypes Armin Wolf
2025-11-11 13:11 ` [PATCH v2 4/4] platform/x86: wmi: Move WMI core code into a separate directory Armin Wolf
2025-11-18 10:08 ` [PATCH v2 0/4] platform/x86: wmi: Prepare for future changes Ilpo Järvinen

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=aScaVgVAk_tH_v-w@black.igk.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=W_Armin@gmx.de \
    --cc=brauner@kernel.org \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=superm1@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 NNTP newsgroup(s).