> > > I don't understand why did you need to use unsigned char. The
> > > locale-dependent comparison functions don't require unsigned char
> > > data.
> >
> > It's false.
> > >From the FreeBSD-current man-page for isaplha(3):
> >
> > For 8-bit wide locales the value of the argument is
> > representable as an unsigned char.....
>
> "Representable as unsigned char" doesn't mean *must* be unsigned char.
> An 8-bit clean library should not care about signed/unsigned characters.
>
> Please show an example of input that doesn't work if you leave the char
> declarations intact, but which starts working if you change the
> declarations to unsigned char.
Here it is:
#include <locale.h>
#include <stdio.h>
#include <ctype.h>
main() {
char c;
c = 'Æ';
setlocale(LC_CTYPE, "ru_RU.KOI8-R");
setlocale(LC_COLLATE, "ru_RU.KOI8-R");
printf("%c\n", toupper(c));
};
This program will _not_ convert c to upper case.
If I change 'char'-->'unsigned char', everythink work fine
(on my FreeBSD box).
>
> > 1) input file for texindex has no information about @documentlanguage
> > and @documentencoding. It would be rather hard to implement that.
>
> If it's hard to implement right, it doesn't mean we need to implement it
> in an incorrect manner.
>
> One possible solution might be a command-line option to texindex that
> supplies the missing information. This information can be gleaned by
> texi2dvi from the Texinfo source, where it is given by the
> @documentlanguage/@documentencoding directives.
Yes, command-line option to specify locale sounds fine to me.
>
> > 2) User can simply setenv LANG 'locale-of-the-document',
> > process document with texindex and then switch back to his native locale.
>
> This is the wrong way: setting LANG globally changes the operation of
> other programs and library functions, which will have unexpected effects
> that users don't want.
>
> This issue has been discussed here during the pretest of Texinfo 4.0 (in
> the context of sorting the indices produced by makeinfo), and the
> conclusion was that locales is not the right way of solving the problem.
>
> > it is _much_ better
> > to have locale support in texindex I suggest, that to have no one at all.
>
> I disagree. IMHO, a bad solution is worse than no solution at all.
> I suggest to try to devise a good solution and then implement it.
May be command-line option is that good solution.
What do people think?
--dima