Three mechanisms exist for specifying strings in UIL files:
As string literals, which may be stored in UID files as either null-terminated strings or compound strings
As compound strings
As wide character strings
Both string literals and compound strings consist of text, a character set, and a writing direction. For string literals and for compound strings with no explicit direction, UIL infers the writing direction from the character set. The UIL concatenation operator (&) concatenates both string literals and compound strings.
Regardless of whether UIL stores string literals in UID files as null-terminated strings or as compound strings, it stores information about each string's character set and writing direction along with the text. In general, UIL stores string literals or string expressions as compound strings in UID files under the following conditions:
When a string expression consists of two or more literals with different character sets or writing directions
When the literal or expression is used as a value that has a compound string data type (such as the value of a resource whose data type is compound string)
UIL recognizes a number of keywords specifying character sets. UIL associates parsing rules, including parsing direction and whether characters have 8 or 16 bits, for each character set it recognizes. It is also possible to define a character set using the UIL CHARACTER_SETfunction.
The syntax of a string literal is one of the following:
'[character_string]'
[#char_set]
"[character_string]"
For each syntax, the character set of the string is determined as follows:
For a string declared as 'character_string', the character set is the code set component of the LANG environment variable, if it is set in the UIL compilation environment; or it is the value of XmFALLBACK_CHARSET if the LANG environment variable is not set or has no code set. By default, the value of XmFALLBACK_CHARSET is ISO8859-1, but vendors may supply different values.
For a string declared as #char_set "string", the character set is char_set.
For a string declared as "character_string", the character set depends on whether the module has a CHARACTER_SET clause and whether the UIL compiler's use_setlocale_flag is set.
If the module has a CHARACTER_SET clause, the character set is the one specified in that clause.
If the module has no CHARACTER_SET clause but the uil command was started with the -s option, or if the Uil() function was started with use_setlocale_flag set, UIL calls the setlocale() function and parses the string in the current locale. The character set of the resulting string is XmFONTLIST_DEFAULT_TAG.
If the module has no CHARACTER_SET clause and the uil command was started without the -s option, or if the Uil() function was started without use_setlocale_flag, the character set is the code set component of the LANG environment variable, if it is set in the UIL compilation environment, or the character set is the value of XmFALLBACK_CHARSET if LANG is not set or has no code set.
UIL always stores a string specified using the COMPOUND_STRING function as a compound string. This function takes as arguments a string expression and optional specifications of a character set, direction, and whether to append a separator to the string. If no character set or direction is specified, UIL derives it from the string expression, as described in the preceding section.
Certain predefined escape sequences, beginning with a \ (backslash), may be displayed in string literals, with the following exceptions:
A string in single quotation marks can span multiple lines, with each new line character escaped by a backslash. A string in double quotation marks cannot span multiple lines.
Escape sequences are processed literally inside a string that is parsed in the current locale (a localized string).