From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7625 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?572X5YuH5YiaKFlvbmdnYW5nIEx1bykg?= Newsgroups: gmane.linux.lib.musl.general,gmane.comp.standards.posix.austin.general,gmane.comp.compilers.clang.devel Subject: Re: 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: Mon, 11 May 2015 11:25:40 +0800 Message-ID: References: <20150509103645.GG29035@port70.net> <20150509200535.GK17573@brightrain.aerifal.cx> <20150511014701.GN30924@vapier> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1431314782 29171 80.91.229.3 (11 May 2015 03:26:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 May 2015 03:26:22 +0000 (UTC) To: =?UTF-8?B?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= , Rich Felker , John Sully , Karsten Blees , musl@lists.openwall.com, dplakosh@cert.org, austin-group-l@opengroup.org, hsutter@microsoft.com, Clang Dev , James McNellis Original-X-From: musl-return-7636-gllmg-musl=m.gmane.org@lists.openwall.com Mon May 11 05:26:18 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 1YreMC-0004sb-TD for gllmg-musl@m.gmane.org; Mon, 11 May 2015 05:26:17 +0200 Original-Received: (qmail 32737 invoked by uid 550); 11 May 2015 03:26:14 -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 32703 invoked from network); 11 May 2015 03:26:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=jgqF/ujq8tnEihHp5SNDKMTB7maYol05Nd7bcwSegF0=; b=fm/aKPMwAvCewBAmdfija6ffcmD1mWQ0XOFOAjz+9a2Npo+Ds6AgvwyZpyYQ+DF86P yF5GEnAlfX3J8v8vPD/+UjnfX2IGO4LkSa/k81l6tiYhv7F2KC2FBL7SmGn0CjCPHbhA ujh/Ute16cuKb2IeIvIw4y2gclZC3z+lNT4LHL3Yd85v2Gf/u3lQM/j4K0AQTbvj4lyH TqQD0s71t6EuwvNwlkg4a02qI2b7OBuNPd2fC24/hnnY/5Wh0Uf6ui5mDj/p0tMVYgoU cxexVqb2uZgcZBR5Lwvo4UXZzRiIVClRoo1wJmVQBAqoPmQQy6rtkHXpWNJOmfKUBInz ZvFQ== X-Received: by 10.107.164.6 with SMTP id n6mr10456672ioe.54.1431314761694; Sun, 10 May 2015 20:26:01 -0700 (PDT) In-Reply-To: <20150511014701.GN30924@vapier> Xref: news.gmane.org gmane.linux.lib.musl.general:7625 gmane.comp.standards.posix.austin.general:10772 gmane.comp.compilers.clang.devel:42688 Archived-At: 2015-05-11 9:47 GMT+08:00 Mike Frysinger : > On 10 May 2015 20:31, =E7=BD=97=E5=8B=87=E5=88=9A(Yonggang Luo) wrote: >> For example, the open function exist both in msvcrt and posix, >> int open(const char *path, int oflag, ...); >> >> But in msvcrt, the path is ANSI encoding, and in posix, path is utf8 enc= oding, > > POSIX has no such encoding requirement on the |path| argument: > http://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html > > on Linux, that buffer is a standard NUL-terminated C string which is pass= ed > directly to the kernel which more or less passes it directly to the fs dr= iver. > how some FS drivers interpret that string depends on the FS. > -mike In linux world, the encoding of path is dependent to FS, that's true:) Even though at nowadays, major FS are UTF-8 as default encoding. But in Win32 world, that's different things, the Win NTFS are using UTF16 for the FS, but under different system locale, (GBK or CP1252) it's would using different encoding(GBK or CP1252) to open the same file. That's make the open function useless on win32. --=20 =E6=AD=A4=E8=87=B4 =E7=A4=BC =E7=BD=97=E5=8B=87=E5=88=9A Yours sincerely, Yonggang Luo