John Darrington <[EMAIL PROTECTED]> writes: > On Sat, Jun 10, 2006 at 02:42:36PM -0700, Ben Pfaff wrote: > > > 2. Obvously macros like CC_ALNUM are only correct for the C locale. > > Not a problem so long as everyone's aware of it, but naive > > programmers might make some mistakes ... > > I'm aware of the problem and trying to think of a good solution. > > I've been thinking a bit about it too. In the case of parsing input > syntax, I think the only solution is, to convert the syntax to > (wchar_t *) using mbstowcs before doing anything with it. > > Thus, functions like become: > > bool lex_is_id1(char c); from data/identifier.c > > become > bool lex_is_id1(wchar_t c); > > testing for alphanumeric characters then is a matter of calling > iswalnum from wctype.h
It's one option. I'm not sure whether it's the best option. (Why do you think it is the only option?) I'm considering implementing something like mb[u]iter.[ch] from gnulib in the struct string implementation. I like that code and that idea. It abstracts away the nastiness of multibyte strings pretty well. > Unfortunately, i18n seems to be difficult no matter what you do. > > Yes, it's hard. Largely because so many existing libraries don't > follow the rules. [...] Well, we have enough problems without placing blame anywhere else... -- Ben Pfaff email: [EMAIL PROTECTED] web: http://benpfaff.org _______________________________________________ pspp-dev mailing list [email protected] http://lists.gnu.org/mailman/listinfo/pspp-dev
