yw_get_default_encoding

Name

yw_get_default_encoding -- get default encoding for current locale

Synopsis


     #include <yw/util.h>
   

char *yw_get_default_encoding();

DESCRIPTION

This function is eqivalent of nl_langinfo(CODESET), except that it is implemented even on systems w/onl_langinfo()or CODESET. Default encoding is determined on the base of LC_ALL, LC_CTYPE and LANG enviorment variables (in this order).

RETURN VALUE

Character encoding acceptable by yw_convert(3).

NOTES

Return value of this function is not always the one used when NULL is specified instead of encoding for LibYW functions. <yw/util.h> specfiles following external variable:

       extern const char *yw_default_encoding;
    
It's initially NULL. Call to function, that needs encoding (like yw_string_assign_cstring(3)) sets this variable to return ofyw_get_default_encoding()then and only then yw_default_encoding is NULL. User is allowed to set yw_default_encoding to whatever (s)he wants, and this value will be used when NULL is specifed instead of encoding.

INFO

Generated from: locale_charset.c,v 1.4 2001/05/04 11:04:23 malekith Exp.