GetSafeName (open)

Generate a safe name for a string

Syntax

LOADLIB "wh::util/langspecific.whlib";

STRING FUNCTION GetSafeName(STRING value, RECORD options)

Parameters

STRING value

Value to use for the name

RECORD options

Options

fallback

Fallback value. Defaults to 'unknown' - may be localized in the future if language != "en"

languagecode

Language code to use for normalization (defaults to 'en')

safedots

Eliminate dots at begin or end

tohyphens

Additional characters to convert to hyphens

utf8

Consider all >= 0xC0 utf-8 characters safe (may eliminate zerowidth spaces and similar chars in the future). Disables normalization

Return value

STRING

Returns 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.