From owner-freebsd-i18n Mon Sep 4 3:50:46 2000 Delivered-To: freebsd-i18n@freebsd.org Received: from columbus.cris.net (columbus.cris.net [212.110.128.65]) by hub.freebsd.org (Postfix) with ESMTP id B74E837B422 for ; Mon, 4 Sep 2000 03:50:38 -0700 (PDT) Received: from ark.cris.net (ark.cris.net [212.110.128.68]) by columbus.cris.net (8.9.3/8.9.3) with ESMTP id NAA73778; Mon, 4 Sep 2000 13:50:05 +0300 (EEST) Received: (from phantom@localhost) by ark.cris.net (8.9.3/8.9.3) id NAA10302; Mon, 4 Sep 2000 13:49:59 +0300 (EEST) (envelope-from phantom) Date: Mon, 4 Sep 2000 13:49:59 +0300 From: Alexey Zelkin To: NUMATA Toshinori Cc: "Andrey A. Chernov" , Alexander Voropay , i18n@FreeBSD.ORG Subject: Re: Request for review: locale aliases support for libc Message-ID: <20000904134959.C7702@ark.cris.net> References: <34d701c01424$4a2e4b60$cd0d11ac@host205.spb.in.rosprin.ru> <20000901192017.B29804@nagual.pp.ru> <200009040341.MAA15473@margaux.rp.open.cs.fujitsu.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <200009040341.MAA15473@margaux.rp.open.cs.fujitsu.co.jp>; from numa@rp.open.cs.fujitsu.co.jp on Mon, Sep 04, 2000 at 12:41:42PM +0900 X-Operating-System: FreeBSD 3.5-STABLE i386 Sender: owner-freebsd-i18n@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG hi, Thanks for explanation NUMATA-san! Same is described in Single User Specification. I think we have no problems with locale name expansion returned as result of setlocale(). Andrey ? Alexander ? On Mon, Sep 04, 2000 at 12:41:42PM +0900, NUMATA Toshinori wrote: > "Andrey A. Chernov" wrote: > > On Fri, Sep 01, 2000 at 06:52:03PM +0400, Alexander Voropay wrote: > >> AFAIK, the presense of any forms of locale "aliasing" does not > >> comply current POSIX specifications : > >> string=setlocale(LC_xxx, "language_TERRITORY.Codeset"); > >> should returns _THE_SAME_ locale name _as requested_. > > > > > > No, it means that returned string should be not expanded to its full form. > > > > I.e. setlocale(LC_ALL, "ru") should return "ru" and not "ru_RU.KOI8-R" > > and do all expansions internally and invisible to caller. > > In my copy of POSIX.1 standard (ISO/IEC 9945-1:1990) says: > > 8.1.2 Extensions to setlocale() Function > ... > 8.1.2.3 Returns > > A successful call to setlocale() returns a string that corresponds > to the locale set. The string returned is such that "a subsequent > call with that string and its associated category will restore > that part of the process's locale" (C Standard {2}). The string > returned shall not be modified by the process, but may be > overwritten by a subsequent call to the setlocale() function. > This string is not required to be the value of the environment > variable used, if one was used. > > It does not say that the returned value must be the same as the string > passed to the setlocale() call, or anything about string expansions. > (POSIX does ont specify the format of locale names, so no definition > of "locale name expantion" at all.) > > The only thing the standard specify is that the call: > > char *locale_string = setlocale(LC_CTYPE, "ru"); > > must return *some* string that indicates the locale set (if the call was > successful) and the subsequent call: > > setlocale(LC_CTYPE, locale_string); > > must produce the same result as the call of setlocale(LC_CTYPE, "ru");. > (Well, the content of locale_string may be changed by the subsequent > calls of setlocale() so the string must be saved to some other buffer.) > > The string returned may be the same as the string passed (for example, > "ru"), may be "expanded" form (for example, "ru_RU.KOI-8R"), or may be > some other implementation-specific form. The only requirement is that > "a subsequent call with that string and its associated category will > restore that part of the process's locale". > > -- > NUMATA Toshinori > Planning Dept., Strategic Planning Div., Software Group, FUJITSU LIMITED > Phone: +81-45-476-4586 (x4224) Fax: +81-45-476-4749 -- /* Alexey Zelkin && phantom@cris.net */ /* Tavric National University && phantom@FreeBSD.org */ /* Sysadmin/Developer && phantom@sms.umc.com.ua */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-i18n" in the body of the message