From: Karsten Blees <karsten.blees-x8bNZE/nUJk@public.gmane.org>
To: "luoyonggang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
<luoyonggang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"musl-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org"
<musl-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org>,
James McNellis
<james-5OgNh6/BCtVKcNVKSCbDRAC/G2K4zDHf@public.gmane.org>,
"austin-group-l-7882/jkIBncuagvECLh61g@public.gmane.org"
<austin-group-l-7882/jkIBncuagvECLh61g@public.gmane.org>,
Clang Dev <cfe-dev-Tmj1lob9twqVc3sceRu5cw@public.gmane.org>,
"blees-x8bNZE/nUJk@public.gmane.org"
<blees-x8bNZE/nUJk@public.gmane.org>,
"dplakosh-etTNj8cnB6w@public.gmane.org"
<dplakosh-etTNj8cnB6w@public.gmane.org>,
"hsutter-0li6OtcxBFHby3iVrkZq2A@public.gmane.org"
<hsutter-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>,
"writeonce-noBqTzJW0ZJAfugRpC6u6w@public.gmane.org"
<writeonce-noBqTzJW0ZJAfugRpC6u6w@public.gmane.org>
Subject: Re: 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: Sun, 10 May 2015 18:47:32 +0000 [thread overview]
Message-ID: <AM3PR03MB121750EF997FF5B1C7403D80F4DC0@AM3PR03MB1217.eurprd03.prod.outlook.com> (raw)
In-Reply-To: <CAE2XoE_vO83dVqmJ3xRb9md8H=EO0j723Ycwqijo1To88iGueA@mail.gmail.com>
Am 09.05.2015 um 05:17 schrieb 罗勇刚(Yonggang Luo) :
> Is that getting wchar_t to be 32bit on win32 a good idea
wchar_t must match what the compiler generates for L"string" literals. Thus you cannot "change" wchar_t in a library or compatibility layer, as it is a compiler property.
Furthermore, using 32-bit wchar_t on Windows would break binary compatibility with existing libraries. And programs that cannot use e.g. kernel32.dll are completely useless, they cannot do anything.
> One primary objective of code portability and posix-compatibility layer for win32 is to _remove_ the need for OS-specific code-paths. A wchar_t that is anything short (no pun intended) of a 32-bit integer will render it impossible to build out of the box many pieces of commonly-used software, including, but not limited to musl libc, the curses library, and anything that expects wchar_t to cover the entire unicode range.
Any software that uses wchar_t to represent Unicode is inherently platform specific / not portable.
For example: POSIX requires that wide characters can be processed in isolation, e.g. each wide character has a specific width (see wcwidth() API and format of character set description files). This doesn't fly with Unicode's combining characters. E.g. a triple of any two Unicode characters followed by tie/breve \u0361 has a width of two. A POSIX-compliant wchar_t would need distinct wide character codes for all such combinations (i.e. requiring at least 3 * 21 = 63 bits).
Therefore, libc implementations that use wchar_t for Unicode cannot be strictly POSIX compliant (independent on whether wchar_t is UTF-32, UTF-16 or UTF-8).
The Unicode specification, chapter 5.2, recommends using char16_t / char32_t for Unicode, not wchar_t.
Just my 2c
Karsten
_______________________________________________
cfe-dev mailing list
cfe-dev@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
prev parent reply other threads:[~2015-05-10 18:47 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)
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 [this message]
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=AM3PR03MB121750EF997FF5B1C7403D80F4DC0@AM3PR03MB1217.eurprd03.prod.outlook.com \
--to=karsten.blees-x8bnze/nujk@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=luoyonggang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=musl-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org \
--cc=writeonce-noBqTzJW0ZJAfugRpC6u6w@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).