From: Neil Jerram <neil@ossau.uklinux.net>
To: Mike Gran <spk121@yahoo.com>
Cc: Guile Development <guile-devel@gnu.org>
Subject: Re: make check fails if no en_US.iso88591 locale
Date: Wed, 09 Sep 2009 22:53:44 +0100 [thread overview]
Message-ID: <873a6v7pjr.fsf@arudy.ossau.uklinux.net> (raw)
In-Reply-To: <322965.9784.qm@web37906.mail.mud.yahoo.com> (Mike Gran's message of "Tue\, 8 Sep 2009 18\:28\:52 -0700 \(PDT\)")
Mike Gran <spk121@yahoo.com> writes:
> My bad. Actually, I should have enclosed the 'with-locale' in the
> context of a 'pass-if', which would have caught the exception.
Yes, but at the cost of not running the tests...
>> I can allow make check to complete by changing that line to
>>
>> (false-if-exception (with-locale "en_US.iso88591"
>>
>> but I doubt that's the best fix. Is the "en_US.iso88591" locale
>> actually important for the enclosed tests?
>
> 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.
>
> If the current locale is C or ASCII, bytes above 127 will cause errors.
> If the current locale is UTF-8, bytes above 127 will be converted into
> multibyte sequences that won't be matched by the regular expression
> being tested. To pass the test in regexp.test, we need to use the
> encoding that matches all of the codepoints 0 to 255 to single byte
> characters, which is ISO-8859-1.
>
> So until a better regex comes along, wrapping regex in an
> 8-bit-clean-friendly locale like Latin-1 is necessary to avoid encoding
> errors when encoding arbitrary 8-bit data like the test does.
>
> The reason why this problem is cropping up now and didn't occur before
> is because the old scm_to_locale_string was just a stub that passed
> 8-bit data through unmodified.
Thanks for explaining; I think I understand now. So then Ludovic's
suggestion of with-latin1-locale should work, shouldn't it?
> 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?
Thanks,
Neil
next prev parent reply other threads:[~2009-09-09 21:53 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 [this message]
2009-09-10 2:36 ` Mike Gran
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=873a6v7pjr.fsf@arudy.ossau.uklinux.net \
--to=neil@ossau.uklinux.net \
--cc=guile-devel@gnu.org \
--cc=spk121@yahoo.com \
/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).