[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fencepost error in encoding processing
From: |
Ludovic Courtès |
Subject: |
Re: fencepost error in encoding processing |
Date: |
Mon, 16 Nov 2009 22:51:48 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Hi Ken,
Ken Raeburn <address@hidden> writes:
> On Nov 16, 2009, at 08:03, Ludovic Courtès wrote:
>> As far as encoding names are concerned, Bruno Haible pointed me to
>> http://www.iana.org/assignments/character-sets and I added a link to
>> it
>> in the manual a couple of days ago.
>
> Between your link and Mike's, it looks to me like we should add
> several more characters.
Yes.
> Since we're scanning an Emacs-style coding specification, as long as
> whitespace and semicolon aren't on the list, I think we can be
> expansive, so let's go ahead and include all of ":,+=/()" to the
> allowed set. The results will still be constrained by whatever the OS
> supports; we just don't want Guile to impose additional constraints.
Agreed.
Note that we follow whatever libunistring implements, which happens to
be IANA AIUI (though it’s case-insensitive.)
> * libguile/read.c (scm_i_scan_for_encoding): Allow more punctuation
> symbols in coding system names.
>
> diff --git a/libguile/read.c b/libguile/read.c
> index 775612a..657e101 100644
> --- a/libguile/read.c
> +++ b/libguile/read.c
> @@ -1506,8 +1506,7 @@ scm_i_scan_for_encoding (SCM port)
> i = 0;
> while (pos + i - header <= SCM_ENCODING_SEARCH_SIZE
> && pos + i - header < bytes_read
> - && (isalnum((int) pos[i]) || pos[i] == '_' || pos[i] == '-'
> - || pos[i] == '.'))
> + && (isalnum((int) pos[i]) || strchr("_-.:/,+=()", pos[i]) != NULL))
Sounds good to me, except for the missing whitespace before ‘(‘. ;-)
Ludo’.