Atmel CAVR-4 Manual De Usuario

Descargar
Página de 323
CAVR-4
Part 1. Using the compiler
The DLIB runtime environment
71
Locale
Locale is a part of the C language that allows language- and country-specific settings for 
a number of areas, such as currency symbols, date and time, and multibyte encoding.
Depending on what runtime library you are using you get different level of locale 
support. However, the more locale support, the larger your code will get. It is therefore 
necessary to consider what level of support your application needs.
The DLIB library can be used in two major modes:
With locale interface, which makes it possible to switch between different locales 
during runtime
Without locale interface, where one selected locale is hardwired into the 
application.
LOCALE SUPPORT IN PREBUILT LIBRARIES
The level of locale support in the prebuilt libraries depends on the library configuration. 
All prebuilt libraries supports the C locale only
Libraries with full library configuration have support for the locale interface. For 
prebuilt libraries with locale interface, it is by default only supported to switch 
multibyte encoding during runtime.
Libraries with normal library configuration do not have support for the locale 
interface.
If your application requires a different locale support, you need to rebuild the library.
CUSTOMIZING THE LOCALE SUPPORT
If you decide to rebuild the library, you can choose between the following locales:
The standard C locale
The POSIX locale
A wide range of international locales.
Locale configuration symbols
The configuration symbol 
_DLIB_FULL_LOCALE_SUPPORT
, which is defined in the 
library configuration file, determines whether a library has support for a locale interface 
or not. The locale configuration symbols 
_LOCALE_USE_LANG_REGION
 and 
_ENCODING_USE_ENCODING
 define all the supported locales and encodings.
If you want to customize the locale support, you simply define the locale configuration 
symbols required by your application. For more information, see Building and using a 
customized library
, page 62.