[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #31650] ice-9 regexp doesn't work with multibyte chars

From: Andy Wingo
Subject: [bug #31650] ice-9 regexp doesn't work with multibyte chars
Date: Sun, 14 Nov 2010 10:59:14 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Safari/531.2+ Epiphany/2.30.2


                 Summary: ice-9 regexp doesn't work with multibyte chars
                 Project: Guile
            Submitted by: wingo
            Submitted on: Sun 14 Nov 2010 10:59:13 AM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any



Steps to reproduce:

> (setlocale LC_ALL)
> (match:substring (string-match ".*" "calçot") 0)

Expected results:


Actual results:

ERROR: In procedure substring:
ERROR: Value out of range 0 to 6: 7

I think what is happening is that as per
the regmatch_t structure gives us *byte offsets* at which the string matched,
but Guile's match structures need *char offsets*. So we need to be able to do
a reverse mapping between byte index of a string as encoded in the current
locale to the character index.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]