HOME

TheInfoList



OR:

In
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and development of both hardware and software. Computing has scientific, ...
, C localization functions are a group of functions in the
C programming language ''The C Programming Language'' (sometimes termed ''K&R'', after its authors' initials) is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the language, as well a ...
implementing basic localization routines. The functions are used in multilingual programs to adapt to the specific locale. In particular, the way of displaying of numbers and currency can be modified. These settings affect the behaviour of input/output functions in the C Standard Library.


Overview of functions

C localization functions and types are defined in ( header in C++).


Criticism

C standard localization functions are criticized because the localization state is stored globally. This means that in a given program all operations involving a locale can use only one locale at a time. As a result, it is very difficult to implement programs that use more than one locale. The functions alter the behavior of printf/scanf/strtod which are often used to write saved data to a file or to other programs. The result is that a saved file in one locale will not be readable in another locale, or not be readable ''at all'' due to assumptions such as "numbers end at comma characters". Most large-scale software forces the locale to "C" (or another fixed value) to work around these problems.


Example

#include #include #include int main(void)


See also

*
Locale (computer software) In computing, a locale is a set of parameters that defines the user's language, region and any special variant preferences that the user wants to see in their user interface. Usually a locale identifier consists of at least a language code and a ...


References

{{Reflist C standard library