Column names in TIBCO Spotfire are stored as UTF-16 encoded strings. Variable names in TIBCO Spotfire Statistics Services are built from 8-bit ASCII characters matching [.0-9a-zA-Z]. The column names that are sent to TIBCO Spotfire Statistics Services must be encoded. Encoding is done automatically when Spotfire sends data to TIBCO Spotfire Statistics Services by way of the built-in data functions input handlers. If you need to provide column name input by some other means (for example, using a document property), you might have to use the NameEncode function manually to encode the column names before you apply the data function.
Decoding might be necessary to interpret column names when the result from a data function is a text report about the columns. Use the NameDecode function to decode results that have not been automatically decoded by Spotfire output handlers.
NameDecode (and NameEncode) can be written as an S-PLUS script for ASCII and ISO-8859-1 characters.
Code UTF-16 to 0-9a-ZA-Z and .
Let 0-9, a-z, A-Z be the digits in a 62-base system. Cast 16-bit characters to unsigned short integers, and then write those integers in the 62-base system. For example, '£' is cast to 162, which is coded to '02C'. Let .. be the starting tag for a coded character.
The code range will be ..001 to ..h31 (where h31 is equal to 65635 in the 62-base system).
Code examples:
NameEncode("Column.2") = "Column.2"
NameEncode("Column 2") = "Column..00w2"
NameEncode("Column £") = "Column..00w..02D"