Print Page as PDF
ENCODE/DECODE CARETS AND CTRL CHARS ICR (1136)

ENCODE/DECODE CARETS AND CTRL CHARS    ICR (1136)

Name Value
NUMBER 1136
IA # 1136
DATE CREATED 1995/02/21
CUSTODIAL PACKAGE MAILMAN
CUSTODIAL ISC San Francisco
USAGE Supported
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE XMCU1
NAME ENCODE/DECODE CARETS AND CTRL CHARS
GENERAL DESCRIPTION
This API contains the following functions:

$$ENCODEUP^XMCU1(STRING) - convert all "^" to "~U~"
$$DECODEUP^XMCU1(STRING) - convert all "~U~" to "^"

$$STRAN^XMCU1(STRING) - convert all control characters to printables
$$RTRAN^XMCU1(STRING) - undo the conversion by $$STRAN^XMCU1
STATUS Active
ID XMCU1
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION VARIABLES
$$ENCODEUP
Takes a string, converts any "^" to "~U~", and
returns the result.

This function is identical to $$ENCODEUP^XMXUTIL (DBIA 2734).

This function is used when putting strings, which may contain "^", into fields
in globals.  Fields in globals are delimited by "^", so any "^" in a string
would, in effect, create an unintended field.  So, before we put such strings
into fields, we convert any "^".  MailMan uses this to convert any subjects
with "^" before putting them in the .01 field in the MESSAGE file, 3.9.

Usage:  S X=$$ENCODEUP^XMCU1(string)
VARIABLES TYPE VARIABLES DESCRIPTION
STRING Input
Any string, usually with one or more "^" in it.
$$DECODEUP
Takes a string, converts any "~U~" to "^", and
returns the result.

This function is identical to $$DECODEUP^XMXUTIL (DBIA 2734).

Usage: S X=$$DECODEUP^XMCU1(STRING)
VARIABLES TYPE VARIABLES DESCRIPTION
STRING Input
A string with embedded "~U~".
$$STRAN
Takes a string, converts any control characters (and
"~") to printable characters, and returns the result.  The conversion may be
undone by $$RTRAN^XMCU1.

Usage: S X=$$STRAN^XMCU1(STRING)

Note:
"~" is replaced by "~>"
$C(I)           by $C(I+64)  for I=0 to 31, for example
$C(0)           by "~@"
$C(1)           by "~A"
$C(7)           by "~G"   (i.e. BELL)
$C(13)          by "~M"   (i.e. CR = Carriage Return)
$C(26)          by "~Z"
$C(31)          by "~_"
etc.
VARIABLES TYPE VARIABLES DESCRIPTION
STRING Input
A string with control characters in it.
$$RTRAN
Takes a string which had been converted by
$$STRAN^XMCU1, undoes the conversion, and returns the result.
VARIABLES TYPE VARIABLES DESCRIPTION
STRING Input
A string whose control characters have been converted
by $$STRAN^XMCU1.