unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer via Libc-alpha <libc-alpha@sourceware.org>
To: Carlos O'Donell <carlos@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v10 2/2] Add generic C.UTF-8 locale (Bug 17318)
Date: Mon, 06 Sep 2021 08:44:43 +0200	[thread overview]
Message-ID: <87eea22of8.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20210906041557.2470672-3-carlos@redhat.com> (Carlos O'Donell's message of "Mon, 6 Sep 2021 00:15:57 -0400")

* Carlos O'Donell:

> +* Support for the C.UTF-8 locale has been added to glibc.  The locale
> +  supports full code-point sorting for all valid Unicode code points.  A
> +  limitation in the framework for fnmatch, regexec, and regcomp requires
> +  a compromise to save space and only ASCII-based range expressions are
> +  supported for now (see bug 28255).  The full size of the locale is
> +  only ~400KiB, with 346KiB coming from LC_CTYPE information for
> +  Unicode. This locale harmonizes downstream C.UTF-8 already shipping in
> +  various downstream distributions.  The locale is not built into glibc,
> +  and must be installed.

Missing space after “Unicode.” (two spaces expected).

> diff --git a/posix/tst-regex.c b/posix/tst-regex.c
> index e7c2b05e86..4be5d173eb 100644
> --- a/posix/tst-regex.c
> +++ b/posix/tst-regex.c
> @@ -150,9 +151,23 @@ test_expr (const char *expr, int expected, int expectedicase)
>    size_t outlen;
>    char *uexpr;
>  
> -  /* First test: search with an UTF-8 locale.  */
> -  if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL)
> -    error (EXIT_FAILURE, 0, "cannot set locale de_DE.UTF-8");
> +  /* First test: search with basic C.UTF-8 locale.  */
> +  printf ("INFO: Testing C.UTF-8.\n");
> +  xsetlocale (LC_ALL, "C.UTF-8");
> +
> +  printf ("\nTest \"%s\" with multi-byte locale\n", expr);
> +  result = run_test (expr, mem, memlen, 0, expected);
> +  printf ("\nTest \"%s\" with multi-byte locale, case insensitive\n", expr);
> +  result |= run_test (expr, mem, memlen, 1, expectedicase);
> +  printf ("\nTest \"%s\" backwards with multi-byte locale\n", expr);
> +  result |= run_test_backwards (expr, mem, memlen, 0, expected);
> +  printf ("\nTest \"%s\" backwards with multi-byte locale, case insensitive\n",
> +	  expr);
> +  result |= run_test_backwards (expr, mem, memlen, 1, expectedicase);
> +
> +  /* Second test: search with an UTF-8 locale.  */
> +  printf ("INFO: Testing de_DE.UTF-8.\n");
> +  xsetlocale (LC_ALL, "de_DE.UTF-8");
>  
>    printf ("\nTest \"%s\" with multi-byte locale\n", expr);
>    result = run_test (expr, mem, memlen, 0, expected);

This is another (or the same?) overwrite of the result variable.

Thanks,
Florian


      reply	other threads:[~2021-09-06  6:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06  4:15 [PATCH v10 0/2] C.UTF-8 Carlos O'Donell via Libc-alpha
2021-09-06  4:15 ` [PATCH v10 1/2] Add 'codepoint_collation' support for LC_COLLATE Carlos O'Donell via Libc-alpha
2021-09-06  4:15 ` [PATCH v10 2/2] Add generic C.UTF-8 locale (Bug 17318) Carlos O'Donell via Libc-alpha
2021-09-06  6:44   ` Florian Weimer via Libc-alpha [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://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eea22of8.fsf@oldenburg.str.redhat.com \
    --to=libc-alpha@sourceware.org \
    --cc=carlos@redhat.com \
    --cc=fweimer@redhat.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).