GetSafeName (open)
Generate a safe name for a string
Syntax
LOADLIB "wh::util/langspecific.whlib";
STRING FUNCTION GetSafeName(STRING value, RECORD options)Parameters
STRING valueValue to use for the name
RECORD optionsOptions
fallbackFallback value. Defaults to 'unknown' - may be localized in the future if language != "en"
languagecodeLanguage code to use for normalization (defaults to 'en')
safedotsEliminate dots at begin or end
tohyphensAdditional characters to convert to hyphens
utf8Consider all >= 0xC0 utf-8 characters safe (may eliminate zerowidth spaces and similar chars in the future). Disables normalization
Return value
STRINGReturns a safe name, returns the fallbackvalue if it cannot figure out a safe name
Description
Convert a string into a name which can be safely used as a file or folder name.