Initializing help system before first use

XNLSgetencid

XNLSgetencid


Purpose
Get the ID associated with an encoding name.
Synopsis
int XNLSgetencid(char *enc);
Argument
enc 
Encoding name
Return value
Encoding ID or a negative value in case of failure.
Further information
1. All encoding conversion routines require an encoding ID to identify the encoding to use: this routine returns the ID associated with a given encoding name.
2. XPRNLS supports natively UTF-8, UTF-16LE (Little Endian), UTF-16BE (big endian), UTF-32LE, UTF-32BE, US-ASCII, ISO-8859-1, ISO-8859-15, CP1252 and RAW (no encoding). For these encodings the same IDs are always returned and a call to this function can be replaced by the corresponding constants: XNLS_ENC_UTF8, XNLS_ENC_UTF16LE, XNLS_ENC_UTF16BE, XNLS_ENC_UTF32LE, XNLS_ENC_UTF32BE, XNLS_ENC_ASCII, XNLS_ENC_88591, XNLS_ENC_885915, XNLS_ENC_CP1252 and XNLS_ENC_RAW. With other encoding names the function may return a different ID for a given encoding after the library has been reset or the program restarted.
3. The availability of not natively supported encodings (for instance "iso-8859-3") depends on the operating system.
4. In addition to proper encoding names the function also accepts the following aliases: "SYS" (default system encoding), "WCHAR" (wide char representation for the system), "FNAME" (file names, on most systems this is the same as "SYS"), "TTY" (encoding of the console output stream), "TTYIN" (encoding of the input stream of the console, this is usually the same as "TTY"), "STDIN" (encoding of the default input stream), "STDOUT" (encoding of the default output stream), "STDERR" (encoding of the default error stream), "UTF-16" (UTF-16LE or UTF-16BE depending on the architecture), "UTF-32" (UTF-32LE or UTF-32BE depending on the architecture).
Related topics