Skip to content

npp_convert

Jurek Muszyński edited this page Dec 19, 2021 · 2 revisions

char *npp_convert(char *src, const char *cp_from, const char *cp_to)

Description

Converts NULL-terminated src from cp_from to cp_to using iconv library. Maximum destination length, including terminating NULL can be 1024 bytes.

Returns

Returns pointer to converted, zero-terminated static string.

Example

// convert UTF-8 string to plain ASCII
char plain[1024];
strcpy(plain, npp_convert(string, "UTF-8", "ASCII//TRANSLIT"));

Notes

Requires NPP_ICONV compilation switch.

Clone this wiki locally