This is the mail archive of the libc-hacker@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Asking a question about Linux


Hello,

Sorry to disturb you, but I have no clue where to ask my question. I
asked a friend who gave me your name. Feel free to direct me to other
sources for finding answers.

I have a pretty stupid question, but I cannot find any answer on the
web, so perhaps you could enlight me.
I've been trying to understand why the setlocale on Linux does not work
as expected:


#include <locale.h>
#include <stdio.h>
#include <langinfo.h>
#include <stdlib.h>

int main()
{
        setlocale(LC_ALL, "");

        printf("locale %s\n", setlocale(LC_ALL, NULL));

        printf("encoding %s\n", nl_langinfo(_NL_CTYPE_CODESET_NAME));

        printf("mb cur max size %d\n",
nl_langinfo(_NL_CTYPE_MB_CUR_MAX));

        printf("max char size %d\n", MB_CUR_MAX);

        return 0;
}


Then setting LC_ALL or LANG to fr_FR.ISO-8859-1, I get:

locale fr_FR
encoding ISO-8859-1
mb cur max size 2
max char size 2

Why is this 2 instead of 1?


How is internationalization supported in Linux and XFree86.

Thanks in advance for your advice and time?

    Pascale.

begin:          vcard
fn:             Pascale DARDAILLER
n:              DARDAILLER;Pascale
org:            ILOG S.A.   http://www.ilog.fr
adr:            Les Taissounières HB2;;1681 Route des Dolines;06560 VALBONNE;;;FRANCE
email;internet: dardaill@ilog.fr
title:          Ilog Views Development Team
tel;work:       +(33) 4 92 96 61 50
tel;fax:        +(33) 4 92 96 61 62
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]