Initializing help system before first use

# XNLSconvstrto

Purpose
Convert a UTF-8 text string to a given encoding.
Synopsis
`const char *XNLSconvstrto(int eid, const char *src, int srclen, int *dstlen);`
Arguments

eid | Encoding ID of the destination
src | Text buffer to transcode
srclen | Length in bytes of the source text buffer (or -1 for a null terminated string)
dstlen | A location where to return the length (in bytes) of the generated string (can be NULL)

Return value
The converted null terminated string or NULL in case of memory allocation error.
Further information
1. This function returns a thread-specific statically allocated buffer that it shares with XNLSconvstrfrom: each call to any of these functions will overwrite the result of the previous call.
2. Any invalid character is replaced by a default symbol (specific to the destination encoding) in the converted string.
3. Mosel uses this function extensively: it is therefore recommended to duplicate any string returned by this routine if you need to pass it to a Mosel API function. Alternatively, use the XNLSconvbufto form of this function where you can specify your own buffer.
Related topics
XNLSconvbufto, XNLSconvstrfrom.
Parent Topic Buffer and string encoding conversion

© 2001-2026 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.