System Functions
CVS( ) Convert Internal Format of Data
   
Formats Convert String: CVS( data$, conversion$ [, ERR=stmtref ] )

Where:

data$ Data to convert. String expression.
conversion$ String that defines the input and output data formats.
stmtref Program line number or statement label to which to transfer control.
   
Returns This format of the CVS function allows for rapid data transformation between two different internal formats such as normal ASCII and BASE64 or UUENCODE.
   
Description The CVS( ) function converts a string of data to different internal formats based on the values defined by conversion$ which is made up of two data definition values separated by a colon. The first data definition value defines the input format. The second defines the desired target format.

For example, to convert normal ASCII to BASE64 the value in conversion$ would be:

"ASCII:BASE64"

Possible values for the input/output formats are:

Format Description
ASCII
(or ANSI)
Normal 8-bit data in ASCII format. The exact character set is based on the operating system currently in use. For most systems, this is ANSI (code table 1252 on Windows) however when DBCS is enabled, use of ASCII will mean the current default character set.
BASE64
or
BASE64URL
or BASE64ANY
The MIME e-mail format BASE64, is a binary to text encoding scheme whereby an arbitrary sequence of bytes is converted to a sequence of printable ASCII characters. The only characters used are the upper- and lower-case alphabetic characters (A–Z, a–z), the numerals (0–9), and the "+" and "/" symbols, with the "=" symbol is a special suffix code. (BASE64URL is an industry recognized variant on BASE64 where the + and / characters are replaced with - and _ respectively). The BASE64ANY should only be used as an input specifier and will allow the system to accept either BASE64 or BASE64URL formatterd data. If used on output standard BASE64 is assumed.

Full specifications for base64 are contained in RFC 1421 and RFC 2045.

CODEnnnn 8-Bit data represented by the industry assigned code page number nnnn. The following codesets are supported on all platforms: (as of build 9182)

MS-DOS Codepage 437 (US English)
MS-DOS Codepage 737 (Greek IBM PC defacto Standard)
MS-DOS Codepage 850 (Multilingual - Latin 1)
MS-DOS Codepage 852 (Multilingual - Latin 2)
MS-DOS Codepage 863 (Canada (French)
MS-DOS Codepage 865 (Norway)
MS-DOS Codepage 866 (Russia)

Additional codepage are available on Windows and can be added to Unix/Linux systems by creating conversion tables in the *plus/codepage directory.

NATIVE When NATIVE is specified, the system will use either ASCII or UTF8 depending on the setting of the 'U8' system parameter. (UTF-8 used when the parameter is non-zero)
RTF This can only be used as input (from) data format and tells the system to strip the RTF formatting information from the input returning just the text.
UUENCODE Uuencode repeatedly takes in a group of three bytes to create a 24-bit value that is split into four groups of six, which are treated as numbers between 0 and 63. Decimal 32 is added to each number and they are output as ASCII characters which will be in the range 32 (space) to 32+63 = 95 (underscore).
URL The URL Encode/Decode is used to convert characters that cannot be used in a Web based URL to their appropriate hexadecimal equivalent with a leading % character.
UTF8 Available on Windows, not currently available on Unix/Linux
UNICODE Available on WIndows, not currently available on Unix/Linux
XML Standard 8-bit data which uses XML encoding for <, >, and & as &lt; &gt; and &amp; respectively. Also converts all characters less than $20$ or greater than $7E$ to their resptive &#xXX; form. (as of build 9190.3)
   
 

The data conversion functionality of the CVS function is a +PxPlus Exclusive