From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7610 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general,gmane.comp.standards.posix.austin.general,gmane.comp.compilers.clang.devel Subject: Re: [cfe-dev] Is that getting wchar_t to be 32bit on win32 a good idea for compatible with Unix world by implement posix layer on win32 API? Date: Sat, 9 May 2015 12:36:45 +0200 Message-ID: <20150509103645.GG29035@port70.net> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1431167850 14164 80.91.229.3 (9 May 2015 10:37:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 May 2015 10:37:30 +0000 (UTC) Cc: luoyonggang@gmail.com, blees@dcon.de, musl@lists.openwall.com, dplakosh@cert.org, austin-group-l@opengroup.org, hsutter@microsoft.com, Clang Dev , James McNellis To: John Sully Original-X-From: musl-return-7622-gllmg-musl=m.gmane.org@lists.openwall.com Sat May 09 12:37:28 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Yr28N-0008I6-PG for gllmg-musl@m.gmane.org; Sat, 09 May 2015 12:37:27 +0200 Original-Received: (qmail 11377 invoked by uid 550); 9 May 2015 10:37:25 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 10158 invoked from network); 9 May 2015 10:36:57 -0000 Mail-Followup-To: John Sully , luoyonggang@gmail.com, blees@dcon.de, musl@lists.openwall.com, dplakosh@cert.org, austin-group-l@opengroup.org, hsutter@microsoft.com, Clang Dev , James McNellis Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Xref: news.gmane.org gmane.linux.lib.musl.general:7610 gmane.comp.standards.posix.austin.general:10760 gmane.comp.compilers.clang.devel:42669 Archived-At: * John Sully [2015-05-09 00:55:12 -0700]: > In my opinion you almost never want 32-bit wide characters once you learn > of their limitations. Most people assume that if they use them they can > return to the one character -> one glyph idiom like ASCII. But Unicode is wchar_t must be at least 21 bits on a system that spports unicode in any locale: it has to be able to represent all code points of the supported character set. in practice this means that the only conforming definition to iso c (and thus posix, c++ and other standards based on c) is a 32bit wchar_t (the signedness can be choosen freely). so the definition is not based on what "you almost never want" or what "most people assume". if the goal is to provide a posix implementation then 16bit wchar_t is not an option (assuming the system wants to be able to communicate with the external world that uses unicode text).