Skip to content

silgy_convert

Jurek Muszyński edited this page May 14, 2019 · 3 revisions

char *silgy_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, silgy_convert(string, "UTF-8", "ASCII//TRANSLIT"));

Notes

Requires ICONV compilation switch.

Clone this wiki locally