GNU bug report logs - #57507
Regular expression matching depends on locale encoding

Previous Next

Package: guile;

Reported by: Jean Abou Samra <jean <at> abou-samra.fr>

Date: Wed, 31 Aug 2022 16:55:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: dsmich <at> roadrunner.com
To: "'Jean Abou Samra'" <jean <at> abou-samra.fr>
Cc: "'57507 <at> debbugs.gnu.org'" <57507 <at> debbugs.gnu.org>
Subject: bug#57507: Regular expression matching depends on locale encoding
Date: Thu, 01 Sep 2022 19:34:17 +0000
[Message part 1 (text/plain, inline)]
Also remember that Guile uses the system C library regex routines. And
is using C strings, not Guile strings.

(sorry for top post, too tired to fight with this web editor)

-Dale

	-----------------------------------------From: "Jean Abou Samra" 
To: 57507 <at> debbugs.gnu.org
Cc: 
Sent: Wednesday August 31 2022 12:55:13PM
Subject: bug#57507: Regular expression matching depends on locale
encoding

 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.

 $ LC_ALL=C guile3.0
 GNU Guile 3.0.7
 Copyright (C) 1995-2021 Free Software Foundation, Inc.

 Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
 This program is free software, and you are welcome to redistribute it
 under certain conditions; type `,show c' for details.

 Enter `,help' for help.
 scheme@(guile-user)> (use-modules (ice-9 regex))
 scheme@(guile-user)> (match:substring (string-match "u203f" "u3091"))
 ice-9/boot-9.scm:1685:16: In procedure raise-exception:
 In procedure make-regexp: Invalid preceding regular expression

 Entering a new prompt. Type `,bt' for a backtrace or `,q' to
continue.
 scheme@(guile-user) [1]> ,q
 scheme@(guile-user)> (match:substring (string-match "[u203f]"
"u3091"))
 $1 = "u3091"
 scheme@(guile-user)>


[Message part 2 (text/html, inline)]

This bug report was last modified 2 years and 209 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.