UnicodeReplace (Unicode function)

From m204wiki
Revision as of 18:19, 25 February 2011 by JAL (talk | contribs)
Jump to navigation Jump to search

Apply the replacement table to this string (Unicode class)

The Sirius Mods Unicode tables specify translations between EBCDIC and Unicode/ASCII. The UNICODE command lets your site create customizations (one or many replacements) of those translations, as described in "Update forms of UNICODE". UnicodeReplace lets you examine a given Unicode string for any replacement characters that may be in effect at your site.

Syntax

%outUnicode = unicode:UnicodeReplace

Syntax terms

%outUnicode A Unicode variable to receive the method object string altered by any replacement characters.
unicode A Unicode string.

Usage notes

  • The method output is the input Unicode string, with those characters specified in the Unicode replacement table replaced by their corresponding Unicode strings. If no Unicode replacement table is in effect, the method merely copies its input.
  • UnicodeReplace is available as of "Sirius Mods" Version 7.3.

Examples

The following example shows a successful call of UnicodeReplace. The U constant function is used in the example.

An updating UNICODE command is used "in-line" with the User Language request to make the example concrete. In actual usage, updating UNICODE commands should only be issued from your Model 204 initialization stream.

UNICODE Table Standard Rep U=2122 '(TM)' begin %u Unicode Initial('Cool™':U) print %u:UnicodeReplace end

The result is:

Cool(TM)

See also