1994-01-25 94-0036; N0423; Proposed criteria for locales and streams; T Plum 1. C provides a simple "go-native" call, setlocale(LC_ALL, "") . This is important enough in non-English environments that WG14 is sometimes asked to make this the default behavior for main. Our eventual C++ solution should provide some simple go-native call (either this one or another one) such that both C and C++ libraries are consistently imbued with the native locale. 2. C provides a "go-specific" call, setlocale(LC_xxx, str) . Our C++ solution should provide a means (either this one or another one) of imbuing the C and C++ locale consistently. 3. In multi-threaded environments, the mechanism chosen should allow (but not require) an implementation to provide the same simple go-native and go-specific calls on a per-thread basis. 4. The committee should hear reasons why methods are required that are more elaborate than the mechanisms of 1, 2, and 3. 5. Amendment 1 of ISO C ("MSE") and the X/Open "locale-object" proposal are available for study. Each took two or three years to define precisely. The committee should know how a C++ locale object compares in semantics to these other standards, with an estimate of the effort to standardize and implement. The preceding items concern the question "Should we have locale objects"; the rest assume that we decide "Yes" to this question. 6. It should be possible to make use of one low-level locale object, such as X/Open's, as the (hidden) implementation of the C and C++ locales. (I believe that this is true for C.) 7. On systems with a full C implementation of the C MSE, it should be possible (but not required) for the C++ library to be hosted on top of C's wide-oriented files. 8. Programmers should be able to provide their own wide/narrow transformations beyond what is provided by the library. 9. The integration of C++ locale object and streams should allow efficient implementation of inserters and extractors for char, wchar_t, array of char, and array of wchar_t. It should be possible for each inserter and extractor to execute without any extra overhead beyond byte-movement. (The ability to add user-programmed transformations may be useful, but should not degrade basic operations.) 10. The POSIX locale definition is an ISO standard, so any C++ locale object should include those POSIX features that go beyond ISO C, including LANG, MESSAGES, time formats, etc. 11. A locale object could provide locale encapsulation for any other object class if it provided a mode in which its construction imbued both C and C++ locales, and its destruction restored the C and C++ locales to their entry values.