From: Dmitry Potapov Date: Tue, 03 Mar 2009 17:13:58 GMT Subject: Re: [RFC PATCH] Windows: Assume all file names to be UTF-8 encoded. Message-ID: <37fcd2780903030913q4ee0e5d0t45dc3b124285f748@mail.gmail.com> In-Reply-To: On Tue, Mar 3, 2009 at 2:48 PM, Peter Krefting wrote: > Dmitry Potapov: > >> The C Standard requires that the type wchar_t is capable of representing >> any character in the current locale. If Windows uses UTF-16 as internal >> encoding (so, it can work with symbols outside of the BMP), it means you >> cannot have 16-bit wchar_t and be compliant with the C standard... > > No, that's not quite correct. wchar_t is defined to be "an integer type > whose range of values can represent distinct codes for all members of the > largest extended character set specified among the supported locales". Since > Windows defines all local character sets as Unicode-based, having wchar_t > defined as Unicode means that it can represent everything. No, it does not, if you have wchar_t that is only 16-bit wide, because characters outside of the BMP have integer values in Unicode greater than 65535... Dmitry