unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mike Gran <spk121@yahoo.com>
To: Neil Jerram <neil@ossau.uklinux.net>
Cc: Guile Devel <guile-devel@gnu.org>
Subject: Re: make check fails if no en_US.iso88591 locale
Date: Wed, 09 Sep 2009 19:36:09 -0700	[thread overview]
Message-ID: <1252550169.24639.66.camel@localhost.localdomain> (raw)
In-Reply-To: <873a6v7pjr.fsf@arudy.ossau.uklinux.net>

On Wed, 2009-09-09 at 22:53 +0100, Neil Jerram wrote:
> > It is important.  This is one of the problems with the whole Unicode
> > effort.  There is no Unicode-capable regex library.  The regexp.test
> > tries matching all bytes from 0 to 255, and it uses scm_to_locale_string
> > to prep the string for dispatch to the libc regex calls and
> > scm_from_locale_string to send them back.  

[...]

> Thanks for explaining; I think I understand now.  So then Ludovic's
> suggestion of with-latin1-locale should work, shouldn't it?

Yeah.  I went with that idea.

> 
> > This regex library actually can be used with arbitrary Unicode data
> > but it takes extra care.  UTF-8 can be used as the locale, and, then
> > regular expression must be written keeping in mind that each non-ASCII
> > character is really a multibyte string.
> 
> Can you give an example of what that ("keeping in mind...") means?  Is
> it being careful with repetition counts (as in "[a-z]{3}"), for
> example?

I'm not much of a regex guy, but, here's a couple of examples.  First
one that sort of works as expected.

guile> (string-match "sé" "José") 
==> #("José" (2 . 5))

Regex properly matches the word, but, the match struct (2 . 5) is
referring to the bytes of the string, not the characters of the string.

Here's one that doesn't work as expected.

guile> (string-match "[:lower:]" "Hi, mom")
==> #("Hi, mom" (5 . 6))
guile> (string-match "[:lower:]" "Hí, móm")
==> #f

Once you add accents on the vowels, nothing matches.

Thanks,

Mike





  reply	other threads:[~2009-09-10  2:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-09  0:45 make check fails if no en_US.iso88591 locale Neil Jerram
2009-09-09  1:28 ` Mike Gran
2009-09-09 21:53   ` Neil Jerram
2009-09-10  2:36     ` Mike Gran [this message]
2009-09-10 10:27       ` Ludovic Courtès
2009-09-10 12:44         ` Mike Gran
2009-09-10 15:33           ` Ludovic Courtès
2009-09-11  4:28             ` Mike Gran
2009-09-10 19:34       ` Neil Jerram
2009-09-10 21:17         ` Mike Gran
2009-09-09  8:08 ` Ludovic Courtès

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=1252550169.24639.66.camel@localhost.localdomain \
    --to=spk121@yahoo.com \
    --cc=guile-devel@gnu.org \
    --cc=neil@ossau.uklinux.net \
    /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).