From owner-freebsd-bugs Sat Mar 9 4:12:29 2002 Delivered-To: freebsd-bugs@freebsd.org Received: from s096-n062.tele2.cz (s096-n062.tele2.cz [213.246.96.62]) by hub.freebsd.org (Postfix) with ESMTP id 2CEA937B417; Sat, 9 Mar 2002 04:12:24 -0800 (PST) Received: from localhost (plusik@localhost) by s096-n062.tele2.cz (8.11.6/8.11.6) with ESMTP id g29CAN605527; Sat, 9 Mar 2002 13:10:23 +0100 (CET) (envelope-from plusik@pohoda.cz) X-Authentication-Warning: s096-n062.tele2.cz: plusik owned process doing -bs Date: Sat, 9 Mar 2002 13:10:23 +0100 (CET) From: Tomas Pluskal X-X-Sender: plusik@s096-n062.tele2.cz To: Garrett Wollman Cc: freebsd-i18n@FreeBSD.ORG, Subject: Re: multibyte(3) functions not working ? In-Reply-To: <200203082129.g28LTf644313@khavrinen.lcs.mit.edu> Message-ID: <20020309130309.H5448-100000@s096-n062.tele2.cz> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > They are broken. (Or perhaps they are relying on new behavior in C99, > but I rather doubt it.) I am forwarding a message from Vlad Harchev : ========================================================================== Hi, I believe BSD guys are just wrong. There is no trace in any specs (I checked Unix98 specs) that mbstowcs and friends should work only for multibyte encodings. So it should be treated as "should work for any encoding". It's also obvious that singlebyte encoding can be considered multibyte (but without shift states) - so their statement could work against themselves. BSD guys should fix locale support in their libc or modify all my patches not to use some other portable and working way (probably using iconv(3)). I won't help with this for free. Best regards, -Vlad ============================================================================ I have a simple question: according to man pages, the wctomb() function should convert wide-char to its multibyte equivalent. When I pass a wide-char (like any non-latin1 character, for example 0x161 in unicode) to this function, it should return its multibyte equivalent. But the character is not in ascii (latin1) table. There are many encodings which contain this character, and all of them contain it as just one byte (as Vlad said, singlebyte is also multibyte). So the function should return the one byte character in one of the possible encodings, but which one ? The current locale's encoding seems to me like a good choice. Tomas Pluskal To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message