UnicodeToUpper and UnicodeToLower (Unicode functions): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
Line 40: Line 40:


Example UnicodeToUpper and UnicodeToLower statements follow:
Example UnicodeToUpper and UnicodeToLower statements follow:
<pre>
     . . .
     . . .
     %u is unicode
     %u is unicode
     %u = '} abC5xyZ! &amp;#x394; &amp;#x531; &amp;#xDF;':u
     %u = '} abC5xyZ! &amp;#x394; &amp;#x531; &amp;#xDF;':u
     printText {~} = '{%u:toUpper}'
     [[Intrinsic classes#printtext|printText]] {~} = '{%u:toUpper}'
     printText {~} = '{%u:toLower}'
     printText {~} = '{%u:toLower}'
     . . .
     . . .
</pre>


The results are:
The results are:
Line 55: Line 53:
</pre>
</pre>


For information about the PrintText statement, see the list
The tilde (<tt>~</tt>) directive is described [[Text and Html statements#The (~) directive|here]].
item [[??]] refid=intprnt..
The tilde (<tt>~</tt>) directive is described [[??]] reftxt=* refid=tildir..

Revision as of 04:33, 21 December 2010

String with lowercase characters changed to

The UnicodeToUpper and UnicodeToLower functions return the Unicode alphabetic characters in the method object string as all-uppercase or all-lowercase characters, respectively. Non-alphabetic characters are returned as is, and the input string undergoes no other change.

Character references are returned for characters that do not translate to an EBCDIC character. The default substitute for non-displayable characters in your environment, say a question mark (?), is returned for characters that translate to an EBCDIC character that is not displayable.

These methods produce a one-character for one-character translation, which will fail to correctly handle unusual characters whose uppercase versions have two-characters, for example.

These functions are available as of Sirius Mods version 7.7.

Syntax

  %outUni = unicode:UnicodeToUpper
  %outUni = unicode:UnicodeToLower

Syntax Terms

%outUni
A Unicode variable to receive the all-uppercase or all-lowercase Unicode characters.
unicode
The input Unicode string.

Examples

Example UnicodeToUpper and UnicodeToLower statements follow:

    . . .
   %u is unicode
   %u = '} abC5xyZ! &#x394; &#x531; &#xDF;':u
   printText {~} = '{%u:toUpper}'
   printText {~} = '{%u:toLower}'
    . . .

The results are:

    %u:UnicodeToUpper = '} ABC5XYZ! &#x0394; &#x0531; ?'
    %u:UnicodeToLower = '} abc5xyz! &#x03B4; &#x0561; ?'

The tilde (~) directive is described here.