xsltlocale: Locale handling

## xsltlocale

xsltlocale - Locale handling

Interfaces for locale handling. Needed for language dependent sorting.

Author(s): Nick Wellnhofer

## Synopsis

    #define XSLT_LOCALE_WINAPI;
    #define XSLT_LOCALE_NONE;
    #define XSLT_LOCALE_POSIX;
    typedef void * xsltLocale;
    typedef xmlChar xsltLocaleChar;
    xsltLocale	xsltNewLocale		(const xmlChar * languageTag);
    int	xsltLocaleStrcmp		(xsltLocale locale,
    					 const xsltLocaleChar * str1,
    					 const xsltLocaleChar * str2);
    void	xsltFreeLocale			(xsltLocale locale);
    xsltLocaleChar *	xsltStrxfrm	(xsltLocale locale,
    					 const xmlChar * string);
    void	xsltFreeLocales			(void);

## Description

## Details

### Macro XSLT_LOCALE_NONE

    #define XSLT_LOCALE_NONE;

Macro indicating that there's no extended locale support

### Macro XSLT_LOCALE_POSIX

    #define XSLT_LOCALE_POSIX;

Macro indicating to use POSIX locale extensions

### Macro XSLT_LOCALE_WINAPI

    #define XSLT_LOCALE_WINAPI;

Macro indicating to use WinAPI for extended locale support

### Typedef xsltLocale

    void * xsltLocale;

### Typedef xsltLocaleChar

    xmlChar xsltLocaleChar;

### xsltFreeLocale ()

    void	xsltFreeLocale			(xsltLocale locale)

Frees a locale created with xsltNewLocale

`locale`: | the locale to free

### xsltFreeLocales ()

    void	xsltFreeLocales			(void)

Cleanup function for the locale support on shutdown

### xsltLocaleStrcmp ()

    int	xsltLocaleStrcmp		(xsltLocale locale,
    					 const xsltLocaleChar * str1,
    					 const xsltLocaleChar * str2)

Compares two strings transformed with xsltStrxfrm

`locale`: | a locale identifier
`str1`: | a string transformed with xsltStrxfrm
`str2`: | a string transformed with xsltStrxfrm
`Returns`: | a value < 0 if str1 sorts before str2, a value > 0 if str1 sorts after str2, 0 if str1 and str2 are equal wrt sorting

### xsltNewLocale ()

    xsltLocale	xsltNewLocale		(const xmlChar * languageTag)

Creates a new locale of an opaque system dependent type based on the language tag.

`languageTag`: | RFC 3066 language tag
`Returns`: | the locale or NULL on error or if no matching locale was found

### xsltStrxfrm ()

    xsltLocaleChar *	xsltStrxfrm	(xsltLocale locale,
    					 const xmlChar * string)

Transforms a string according to locale. The transformed string must then be compared with xsltLocaleStrcmp and freed with xmlFree.

`locale`: | locale created with xsltNewLocale
`string`: | UTF-8 string to transform
`Returns`: | the transformed string or NULL on error