pspp-dev
[Top][All Lists]
Advanced

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

Re: Internationalising strings


From: Ben Pfaff
Subject: Re: Internationalising strings
Date: Mon, 12 Jun 2006 09:36:51 -0700
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

John Darrington <address@hidden> 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: address@hidden
web: http://benpfaff.org




reply via email to

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