unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Jean Abou Samra <jean@abou-samra.fr>
Cc: 57507@debbugs.gnu.org
Subject: bug#57507: Regular expression matching depends on locale encoding
Date: Mon, 05 Sep 2022 21:24:35 +0200	[thread overview]
Message-ID: <87czc939qk.fsf@gnu.org> (raw)
In-Reply-To: <a9cd5f37-caef-0554-ad5a-a5f1f7fd7919@abou-samra.fr> (Jean Abou Samra's message of "Mon, 5 Sep 2022 20:39:26 +0200")

Hi,

Jean Abou Samra <jean@abou-samra.fr> skribis:

> Le 05/09/2022 à 09:48, Ludovic Courtès a écrit :
>> Hi Jean,
>>
>> Jean Abou Samra <jean@abou-samra.fr> skribis:
>>
>>> Regular expressions do funky things with Unicode if a non-Unicode-aware
>>> locale is set. Yet, they're purely string operations, so I don't think
>>> it's expected that they depend on the locale encoding.
>> This is the expected behavior: first because (ice-9 regex) is
>> implemented in terms of the libc regex functions, as Dale put (but that
>> could be thought as an implementation detail), and second because things
>> such as character classes are necessarily locale-dependent (this has
>> bitten us in the past, for instance with <https://bugs.gnu.org/35785>).
>>
>> I hope that makes sense.
>
>
>
> OK, thanks, but in this case, it should be clearly stated as a limitation
> in the (ice-9 regex) documentation IMHO. If you don't know what constraints
> there are on the implementation, there is no reason to expect this. Would it
> help if I submitted a patch for that?

Yes, that’d be welcome.  I would not call it a constraint or limitation;
for example, that ‘w’ is not a letter in Swedish is the kind of thing
you’d generally want to take into account.  Now, it’d be nice if one
could easily specify the locale to operate under, with an API similar to
that of (ice-9 i18n) and its first-class locale objects.

Thanks,
Ludo’.





  reply	other threads:[~2022-09-05 19:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-31 16:54 bug#57507: Regular expression matching depends on locale encoding Jean Abou Samra
2022-09-01 19:34 ` dsmich
2022-09-05  7:48 ` Ludovic Courtès
2022-09-05 18:39   ` Jean Abou Samra
2022-09-05 19:24     ` Ludovic Courtès [this message]
2022-11-17 20:33       ` Jean Abou Samra

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/guile/

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

  git send-email \
    --in-reply-to=87czc939qk.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=57507@debbugs.gnu.org \
    --cc=jean@abou-samra.fr \
    /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).