Skip to content

npp_filter_strict

Jurek Muszyński edited this page Mar 31, 2022 · 2 revisions

char *npp_filter_strict(const char *string)

Description

Filters string, retaining only characters suitable for a file name. This means only lower- and upper-case English letters and digits. Spaces are converted to underscores. Maximum destination length, including terminating NULL can be NPP_LIB_STR_BUF bytes.

Returns

Returns pointer to converted, zero-terminated static string.

Example

// let user download generated file
RES_CONTENT_DISPOSITION("attachment; filename=\"%s.pdf\"", npp_filter_strict(npp_convert(name, "UTF-8", "ASCII//TRANSLIT")));

Clone this wiki locally