ParamStrUTF8 function
Gets the specified command line parameter and converts it to a UTF-8-encoded string.
Declaration
function ParamStrUTF8(Param: Integer): stringArguments
Param | Ordinal position for the command line parameter retrieved in the routine. |
Function result
UTF-8-encoded value for the specified command line parameter.
Description
ParamStrUTF8 is a
String function used to convert the
specified command line parameter to a UTF-8-encoded string. The
implementation for ParamStrUTF8 is OS- or platform-specific. For UNIX-like
environments, SysToUTF8 is called to convert the value for the command line
parameter at the position in Param. For Windows platforms, the stub for the
Ansi or WideString version of ParamStrUTF8 is called. ParamStrUTF8 is the
UTF-8-enabled counterpart to the ParamStr routine in RTL.
Index is the ordinal position for the requested parameter value.
Index should be in the range
0..ParamCount
. Values in Index
outside this range cause an empty string ('') to be returned for a parameter
value.
In most cases, the parameter at position 0 contains the name and optional path to the executable file for the application. For cross-platform compatibility, use the ExeName property in TCustomApplication to get the path and name for the binary instead. Subsequent index positions contain any command line arguments passed to the executable.
The return value contains the UTF-8-encoded string with the value for the parameter at the specified position, or an empty string when not present.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
