From owner-freebsd-i18n Sun Sep 3 20:42:54 2000 Delivered-To: freebsd-i18n@freebsd.org Received: from fgwmail7.fujitsu.co.jp (fgwmail7.fujitsu.co.jp [192.51.44.37]) by hub.freebsd.org (Postfix) with ESMTP id BABDE37B424; Sun, 3 Sep 2000 20:42:49 -0700 (PDT) Received: from m2.gw.fujitsu.co.jp by fgwmail7.fujitsu.co.jp (8.9.3/3.7W-MX0006-Fujitsu Gateway) id MAA13018; Mon, 4 Sep 2000 12:41:44 +0900 (JST) (envelope-from numa@rp.open.cs.fujitsu.co.jp) Received: from margaux.rp.open.cs.fujitsu.co.jp by m2.gw.fujitsu.co.jp (8.9.3/3.7W-0008-Fujitsu Domain Master) id MAA04568; Mon, 4 Sep 2000 12:41:43 +0900 (JST) Received: (from numa@localhost) by margaux.rp.open.cs.fujitsu.co.jp (8.9.3+3.2W/3.6W) id MAA15473; Mon, 4 Sep 2000 12:41:42 +0900 (JST) Message-Id: <200009040341.MAA15473@margaux.rp.open.cs.fujitsu.co.jp> From: numa@rp.open.cs.fujitsu.co.jp (NUMATA Toshinori) Date: Mon, 4 Sep 2000 12:41:42 +0900 In-Reply-To: <20000901192017.B29804@nagual.pp.ru> References: <34d701c01424$4a2e4b60$cd0d11ac@host205.spb.in.rosprin.ru> <20000901192017.B29804@nagual.pp.ru> X-Mailer: Mail User's Shell (7.2.6 beta(5) 10/07/98) To: "Andrey A. Chernov" , Alexander Voropay Subject: Re: Request for review: locale aliases support for libc Cc: i18n@FreeBSD.ORG, phantom@FreeBSD.ORG Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-i18n@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG "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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-i18n" in the body of the message