> Some comments: > 1- I think that printf(string_constant) and printf(char_array) should give > the same > output in any circumstance. > 2- In absence of a call to setlocale printf((string_constant) writes > according to > the locale of the environment, but printf(char_array) does not, even > though it is > affected by the locale of the environment.
No, both work according to the "C" locale, with its UTF-8 character set, and behaviour for invalid UTF-8 sequences is undefined for both. "Undefined" means anything might happen, including inconsistent behaviour. (Requiring consistent behaviour would make the puts optimisation impossible.) > 3- I think that a program that was written for locale=C should work without > modification > if the locale in the environment is any of the one-byte characters ones. > 4- I think that a plain C (8-bit transparent) locale should be available, > even if it > is not the default one. If you don't call setlocale, all you can expect according to the C and POSIX standards is the so-called portable character set. So you shouldn't assume that the C locale is 8-bit transparent. However, since that is a valid assumption on Linux and others, Cygwin might indeed be better off following their example. There's a discussion about that on cygwin-developers. Andy -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple