C localization functions: Difference between revisions

Content deleted Content added
Usage: a bit of cleanup
add criticism section
Line 3:
{{C Standard Library}}
In [[computing]], '''locale.h''' is a [[C (programming language)|C]] programming language [[header file]], used for purposes of [[Internationalization and localization|localization]]. The header provides two key functions: <code>localeconv</code> and <code>setlocale</code>. The former provides access to the current locale, while the latter allows one to set the current locale. The header also defines the [[C++ classes|struct]] <code>lconv</code>, which stores information about a given locale, including the local preference for the display of numbers and currency.
 
==Criticism==
 
{{expand section}}
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.<ref>{{cite web | title=The Standard C Locale and the Standard C++ Locales | url=http://www.math.hkbu.edu.hk/parallel/pgi/doc/pgC++_lib/stdlibug/sta_9169.htm | publisher=Rogue Wave Software, Inc. | year=1996}}</ref>
 
==Overview of functions==