diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-08-27 00:09:30 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-08-27 00:09:30 +0200 |
commit | 7aa394b53c289c1f05dacaef8a9167fbaecc00fa (patch) | |
tree | 856ce45911e33ca8fffadc3c212e7e8a1c551e55 /doc/ref/api-regex.texi | |
parent | fd99e505d794049bb1a06aa1e9de8a0f9cff6689 (diff) | |
download | guile-7aa394b53c289c1f05dacaef8a9167fbaecc00fa.tar.gz |
doc: Fix description of regexp/locale encoding interaction.
* doc/ref/api-regex.texi (Regexp Functions): Update paragraph that
mentions locale encoding and strings-as-bytes.
* test-suite/tests/regexp.test ("nonascii locales")["match structures
refer to char offsets, non-ASCII pattern"]: New test.
Diffstat (limited to 'doc/ref/api-regex.texi')
-rw-r--r-- | doc/ref/api-regex.texi | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/doc/ref/api-regex.texi b/doc/ref/api-regex.texi index 11a31fca0..082fb874d 100644 --- a/doc/ref/api-regex.texi +++ b/doc/ref/api-regex.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. -@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 2009, 2010 +@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 2009, 2010, 2012 @c Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. @@ -54,11 +54,12 @@ Zero bytes (@code{#\nul}) cannot be used in regex patterns or input strings, since the underlying C functions treat that as the end of string. If there's a zero byte an error is thrown. -Patterns and input strings are treated as being in the locale -character set if @code{setlocale} has been called (@pxref{Locales}), -and in a multibyte locale this includes treating multi-byte sequences -as a single character. (Guile strings are currently merely bytes, -though this may change in the future, @xref{Conversion to/from C}.) +Internally, patterns and input strings are converted to the current +locale's encoding, and then passed to the C library's regular expression +routines (@pxref{Regular Expressions,,, libc, The GNU C Library +Reference Manual}). The returned match structures always point to +characters in the strings, not to individual bytes, even in the case of +multi-byte encodings. @deffn {Scheme Procedure} string-match pattern str [start] Compile the string @var{pattern} into a regular expression and compare |