mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "罗勇刚(Yonggang Luo) " <luoyonggang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "John Sully" <john-FZqURIBfT/qw5LPnMra/2Q@public.gmane.org>,
	"勇刚 罗 (Yonggang Luo)"
	<luoyonggang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"Karsten Blees" <blees-x8bNZE/nUJk@public.gmane.org>,
	musl-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org,
	dplakosh-etTNj8cnB6w@public.gmane.org,
	austin-group-l-7882/jkIBncuagvECLh61g@public.gmane.org,
	hsutter-0li6OtcxBFHby3iVrkZq2A@public.gmane.org,
	"Clang Dev" <cfe-dev-Tmj1lob9twqVc3sceRu5cw@public.gmane.org>,
	"James McNellis"
	<james-5OgNh6/BCtVKcNVKSCbDRAC/G2K4zDHf@public.gmane.org>
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 19:19:14 +0800	[thread overview]
Message-ID: <CAE2XoE8M1nxo=bCH0opS4unTUuZLmGYgRHOXRHLb6gszqRviZw@mail.gmail.com> (raw)
In-Reply-To: <20150509103645.GG29035-4P1ElwuDYu6sTnJN9+BGXg@public.gmane.org>

2015-05-09 18:36 GMT+08:00 Szabolcs Nagy <nsz-4P1ElwuDYu6sTnJN9+BGXg@public.gmane.org>:
> * John Sully <john-FZqURIBfT/qw5LPnMra/2Q@public.gmane.org> [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).
wchar_t is not the only way to communicate with the external way, and
it's also not suite for communicate to the external world,
from the C11 standard, it's never restrict the wchar_t's width, and
for Posix, most API are implement in
utf8, and indeed, Windows need the posix layer mainly because of those
API that using utf8, not wchar_t APIs,
for the communicate reason to getting wchar_t to be 32 bit on Win32 is
not a good idea,

And for portable text processing(Including win32) apps or libs, they
would and should never dependents on the wchar_t must be 32 bit width.

And C11/C++11 already provide uchar.h to provide cross-platform
char16_t and char32_t, so there is no reason to getting wchar_t to be
32bit
on win32 for suport posix on win32.


We were intent to creating a usable posix layer on win32, not creating
a theoretical POSIX layer that would be useless, on win32, we should
considerate the de facto things
on win32.


-- 
         此致
礼
罗勇刚
Yours
    sincerely,
Yonggang Luo



  parent reply	other threads:[~2015-05-09 11:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-09  3:16 罗勇刚(Yonggang Luo) 
2015-05-09  3:32 ` Rich Felker
2015-05-09  3:36   ` 罗勇刚(Yonggang Luo) 
     [not found] ` <CAE2XoE_vO83dVqmJ3xRb9md8H=EO0j723Ycwqijo1To88iGueA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-09  7:55   ` John Sully
2015-05-09 10:36     ` [cfe-dev] " Szabolcs Nagy
     [not found]       ` <20150509103645.GG29035-4P1ElwuDYu6sTnJN9+BGXg@public.gmane.org>
2015-05-09 11:19         ` 罗勇刚(Yonggang Luo)  [this message]
2015-05-09 20:05           ` Rich Felker
2015-05-10 12:19             ` 罗勇刚(Yonggang Luo) 
2015-05-10 12:31             ` 罗勇刚(Yonggang Luo) 
2015-05-10 13:42               ` Rich Felker
     [not found]                 ` <20150510134230.GN17573-C3MtFaGISjmo6RMmaWD+6Sb1p8zYI1N1@public.gmane.org>
2015-05-10 14:15                   ` [musl] " 罗勇刚(Yonggang Luo) 
2015-05-10 15:30                     ` Rich Felker
     [not found]               ` <CAE2XoE8ARm6BkarKYspPK_uDkePw8PewHXPWRXmT+mGM5mwEaw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-11  1:47                 ` [musl] " Mike Frysinger
2015-05-11  3:25                   ` 罗勇刚(Yonggang Luo) 
2015-05-11 10:27                   ` [musl] " Joerg Schilling
2015-05-12  3:21                     ` 罗勇刚(Yonggang Luo) 
2015-05-10 18:47 ` Karsten Blees

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAE2XoE8M1nxo=bCH0opS4unTUuZLmGYgRHOXRHLb6gszqRviZw@mail.gmail.com' \
    --to=luoyonggang-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=austin-group-l-7882/jkIBncuagvECLh61g@public.gmane.org \
    --cc=blees-x8bNZE/nUJk@public.gmane.org \
    --cc=cfe-dev-Tmj1lob9twqVc3sceRu5cw@public.gmane.org \
    --cc=dplakosh-etTNj8cnB6w@public.gmane.org \
    --cc=hsutter-0li6OtcxBFHby3iVrkZq2A@public.gmane.org \
    --cc=james-5OgNh6/BCtVKcNVKSCbDRAC/G2K4zDHf@public.gmane.org \
    --cc=john-FZqURIBfT/qw5LPnMra/2Q@public.gmane.org \
    --cc=musl-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).