GetAppConfigFileUTF8 function
Gets a UTF-8-encoded configuration file name for the current application.
Declaration
function GetAppConfigFileUTF8(Global: Boolean; SubDir: Boolean=False;
CreateDir: Boolean=False): stringDescription
GetAppConfigFileUTF8 is a
String function used to get a
UTF-8-encoded configuration file name for the current application.
GetAppConfigFileUTF8 calls the
GetAppConfigFile function in the
SysUtils unit to get the return value for the function.
SysToUTF8 is called for the file name to ensure that it is encoded
using the UTF-8 encoding scheme.
Global is a
Boolean which indicates whether system- or
user-specific path information is used in the configuration file name. When
Global contains
True, the system-wide configuration path is used in
the return value. Otherwise, a user-specific path is used in the return value.
SubDir is a
Boolean value that indicates if a
sub-directory for the application is included in the path for the
configuration file. When SubDir is
True, a "Config" sub-directory is
included in the path information.
CreateDir is a
Boolean argument that indicates if any
missing directories in the configuration file path are created in the
function. When CreateDir is
False, no additional actions are performed
in the function. Otherwise, the path information is passed to
ForceDirectoriesUTF8 to create any missing directories. If any of
the directories are not successfully created, an
EInOutError
exception is raised with the message in
lrsUnableToCreateConfigDirectoryS.
The return value contains the path to the configuration file including the requested path, configuration file name, and configuration file extension.
Errors
Raises an EInOutError exception when directories in the path cannot be created on the local file system.
See also
An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.
