1 LIBCHARSET - portable character set determination library 2 3This library provides a function which determines the character set / encoding 4of text in the currently selected locale (the LC_CTYPE locale facet). 5 6It is useful for portable programs which need to process text in other 7encodings and locales than the currently selected one. Possible uses: 8 9 * Use of Unicode in POSIX compliant applications. 10 * Conversion of text between the current locale's encoding and UTF-8 (or 11 any other given encoding). 12 * Mail agents. 13 14In theory, this would be very simple: The Single Unix Specification (SUSV2) 15provides the nl_langinfo function, in such a way that 16 17 nl_langinfo (CODESET) 18 19returns the encoding name. But the nl_langinfo function still does not exist 20on some systems, and on those where it exists it returns unstandardized 21variations of the encoding names, like (on Solaris) "PCK" for "Shift_JIS". 22 23This library fixes these flaws and provides a function 24 25 const char * locale_charset (void); 26 27It determines the current locale's character encoding, and canonicalizes it 28into one of the canonical names listed in config.charset. The result must 29not be freed; it is statically allocated. If the canonical name cannot be 30determined, the result is a non-canonical name. 31 32 33Installation: 34 35As usual for GNU packages: 36 37 $ ./configure --prefix=/usr/local 38 $ make 39 $ make install 40 41 42This library is used in 43 GNU sh-utils, fileutils, textutils 44 GNU gettext 45 GNU clisp 46 47 48To integrate this library into your package: 49See file INTEGRATE. 50 51 52Distribution: 53 The libcharset directory of 54 ftp://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.8.tar.gz 55 56Homepage: 57 http://www.haible.de/bruno/packages-libcharset.html 58 59 60Bruno Haible <bruno@clisp.org> 61