LogiView

Function 'getenv'

     

This function returns a string containing the value of an environment variable. If the environment variable is not set, an empty string is returned.

 

The EDM Server uses internally the UTF-8 encoding to store string data. Thus, the server needs to convert strings provided by the Operating System with the Operating System function getenv into UTF-8 encoding.

 

Syntax:

  {STR_VAR}= getenv({STR_EXPR})
 

I/O parameters:

{STR_EXPR}

Environment variable to be read

The name of an environment variable must always be in ASCII.

-  
 

Return value:

 
{STR_VAR} Value of environment variable
 

Example:

  Declaration of Variables
 
10 DOCU_STRING_1 = getenv("DATAVIEW_TEMP")
20 put(DOCU_STRING_1)
  Result:
  "DOCU_STRING_1" contains the path of "DATAVIEW_TEMP".

Functions and commands: Operating System Interface

 

UTF8 Conversion on UNIX Server

 

When the EDM Server is installed on UNIX and the LogiView function 'getenv' is used to get the content of an environment variable, the converter name is derived from the locale settings, especially the LANG environment variable.

To use UTF-8 as locale setting, the following values can be set in the customizing script of Agile e6.

Use csh syntax.

  • HP-UX:
    setenv LANG "en_US.utf8"
  • Other Unix platforms:
    setenv LANG "en_US.UTF-8"

Scripts that set environment variables for the EDM Server must be written using the correct encoding.

The environment variable LANG must be set to the matching value, and the variable must also contain data matching this setting, before the EDM Server starts up and before the UTF-8 environment variable will be set.

 

UTF8 Conversion on Windows Server

 

On Windows, the C API function _wgetenv is used. With this function the server reads environment strings in Unicode and converts the values to UTF-8 internally.

Values stored via the Windows Control Panel - including predefined variables like USERNAME and PATH - may contain any Unicode character.

Scripts that set environment variables for the EDM server to non-ASCII values must be written using the correct Windows codepage. The Windows command shell (cmd.exe) does not support Unicode without additional configuration.