From: Florian Weimer <fweimer@redhat.com>
To: Siddhesh Poyarekar via Libc-alpha <libc-alpha@sourceware.org>
Cc: Siddhesh Poyarekar <siddhesh@sourceware.org>
Subject: Re: [PATCH v3] setlocale: Fail if iconv module for charset is not present [BZ #27996]
Date: Thu, 17 Feb 2022 09:08:16 +0100 [thread overview]
Message-ID: <87sfshyky7.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20220208094034.1075797-1-siddhesh@sourceware.org> (Siddhesh Poyarekar via Libc-alpha's message of "Tue, 8 Feb 2022 15:10:34 +0530")
* Siddhesh Poyarekar via Libc-alpha:
> +/* Return true if we have gconv modules to transform between the INTERNAL
> + encoding and CODESET. */
> +static bool
> +codeset_has_module (const char *codeset)
> +{
> + struct __gconv_step *steps;
> + size_t nsteps;
> +
> + char *ccodeset = (char *) alloca (strlen (codeset) + 3);
> + strip (ccodeset, codeset);
> +
> + if (__gconv_find_transform ("INTERNAL", ccodeset, &steps, &nsteps, 0)
> + != __GCONV_OK)
> + return false;
> + __gconv_close_transform (steps, nsteps);
> +
> + if (__gconv_find_transform (ccodeset, "INTERNAL", &steps, &nsteps, 0)
> + != __GCONV_OK)
> + return false;
> + __gconv_close_transform (steps, nsteps);
> +
> + return true;
> +}
I think we should actually load the converters and keep them loaded.
See __wcsmbs_load_conv. I'm worried this is actually much more
complicated than expected. 8-(
Thanks,
Florian
prev parent reply other threads:[~2022-02-17 8:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-30 8:56 [PATCH] " Siddhesh Poyarekar
2021-07-16 20:28 ` Carlos O'Donell
2021-07-19 8:34 ` Siddhesh Poyarekar
2021-07-20 2:36 ` [PATCH v2] " Siddhesh Poyarekar
2021-08-11 7:42 ` [PING][PATCH " Siddhesh Poyarekar
2021-08-17 2:58 ` [PING2][PATCH " Siddhesh Poyarekar
2021-10-18 13:16 ` [PING3][PATCH " Siddhesh Poyarekar
2022-02-08 9:40 ` [PATCH v3] " Siddhesh Poyarekar
2022-02-17 8:08 ` Florian Weimer [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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sfshyky7.fsf@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=siddhesh@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).