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

Re: Anybody working on ISO/IEC 15435 (i18n.h)?



keld@xxxxxxxx (Keld J¢rn Simonsen)  wrote on 03.02.00 in <20000203161346.A4914@xxxxxxxxxxxxxx>:

> On Mon, Jan 31, 2000 at 08:25:00PM +0200, Kai Henningsen wrote:

> > - stringn?copy is stringn?cpy in the C bindings. All other names are
> > identical.
>
> Is that a problem?

Well, it's a difference without any explanation. One wonders if it was  
even intentional.

> > - there are a number of types that are translated as structs. This is
> > probably a bad idea; all of them are allocated, manipulated, and freed by
> > the library, so they probably ought to be opaque pointers (like FILE *).
>
> Maybe. It is a matter of style. The idea was that the library
> would handle the required operations to deal with the object.
> We also need to think of binding to other languages, such as
> Fortran, Cobol, lisp, prolog and APL.

An opaque pointer should work with just about anything. No problems with  
structure passing conventions, either.

> Is this C or C++, or both?

I'm not a C++ person.

> > I'm interested in implementing at least part of this, if we can clear up
> > the interface problems.
>
> Very good! Are you coperating with Uli?

Do you mean Ulrich Drepper? Not so far. Is he working on something  
similar?

Anyway, whatever I do would be under a free enough license, though I'll  
probably not spend much thought on details until there is something with  
enough substance so others would actually be interested in having it :-)

The one thing I'm pretty sure about is if I write an i18n.h, that header  
file will be about as free as I can make it ("can be used by everybody for  
any purpose at all" or something along those lines) - the more people use  
the same header file, the less porting problems there are.

Which reminds me I probably want to have some internal type in place of  
wchar_t, in case someone wants to port to a compiler where wchar_t isn't  
large enough to hold 31 bits. (I remember seeing sizeof(wchar_t)==2 once.)

typedef __i18n_wchar_t = wchar_t;

or something along those lines, so people with a broken wchar_t can just  
change that line.

Of course, sizeof(wchar_t) == sizeof(L'x') and thus these people have  
another problem.

Hmm. We really want some function to convert L"foo" into a string. Say,

string conststring(const wchar_t *s);

or something like that.

And probably something for the reverse, for use with the C standard *w*  
routines.

Problem is, we do not even know wchar_t is UCS-4 (or UTF-16). Hmm. Not so  
good. I'll have to think about that a little longer.


MfG Kai
-
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/lists/