Skip to content

silgy_filter_strict

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

bool silgy_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 1024 bytes.

Returns

Returns pointer to converted, zero-terminated static string.

Example

// let user download generated file
RES_CONTENT_DISPOSITION("attachment; filename=\"%s.pdf\"", silgy_filter_strict(silgy_convert(name, "UTF-8", "ASCII//TRANSLIT")));
Clone this wiki locally