UnicodeToUpper and UnicodeToLower (Unicode functions): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (syntax terms, tags and links)
Line 1: Line 1:
{{Template:Unicode:UnicodeToUpper and UnicodeToLower subtitle}}
{{Template:Unicode:UnicodeToUpper and UnicodeToLower subtitle}}


The UnicodeToUpper and UnicodeToLower functions return the Unicode alphabetic
The <var>UnicodeToUpper</var> and <var>UnicodeToLower</var> 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.
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
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 (<code>?</code>), is returned for characters that translate to an EBCDIC character that is not displayable.
translate to an EBCDIC character.
The default substitute for non-displayable characters
in your environment, say a question mark (<tt>?</tt>),
is returned for characters that translate to an EBCDIC character that is not displayable.


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


These functions are available as of <var class=product>Sirius Mods</var> version 7.7.
==Syntax==
==Syntax==
{{Template:Unicode:UnicodeToUpper syntax}}
{{Template:Unicode:UnicodeToUpper syntax}}
Line 23: Line 12:
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%outUni </th>
<tr><th>%outUnicode</th>
<td>A Unicode variable to receive the all-uppercase or all-lowercase Unicode characters. </td></tr>
<td>A Unicode variable to receive the all-uppercase or all-lowercase <var>Unicode</var> characters. </td></tr>
<tr><th>unicode </th>
<tr><th>unicode</th>
<td>The input Unicode string.</td></tr>
<td>The input <var>Unicode</var> string.</td></tr>
</table>
</table>
==Usage Notes==
<ul><li><var>UnicodeToUpper</var> / <var>UnicodeToLower</var> are available as of <var class="product">[[Sirius Mods|"Sirius Mods"]]</var> Version 7.7.</ul>
==Examples==
==Examples==
 
<ol><li>
Example UnicodeToUpper and UnicodeToLower statements follow:
The following code fragment:
<p class="code">. . .
<p class="code">. . .
%u is unicode
%u is unicode
%u = '} abC5xyZ! &amp;#x394; &amp;#x531; &amp;#xDF;':u
%u = '} abC5xyZ! &amp;#x394; &amp;#x531; &amp;#xDF;':[[U (String function)|U]]
[[Intrinsic classes#printtext|printText]] {~} = '{%u:toUpper}'
[[Intrinsic classes#printtext|printText]] {[[Text and Html statements#tilde|~]]} = '{%u:UnicodetoUpper}'
printText {~} = '{%u:toLower}'
printText {~} = '{%u:UnicodetoLower}'
. . .
. . .


</p>
</p>
The results are:
Will produce:
<p class="code">%u:UnicodeToUpper = '} ABC5XYZ! &amp;#x0394; &amp;#x0531; ?'
<p class="code">%u:UnicodeToUpper = '} ABC5XYZ! &amp;#x0394; &amp;#x0531; ?'
%u:UnicodeToLower = '} abc5xyz! &amp;#x03B4; &amp;#x0561; ?'
%u:UnicodeToLower = '} abc5xyz! &amp;#x03B4; &amp;#x0561; ?'
</p>
</p></ol>


The tilde (<tt>~</tt>) directive is described [[Text and Html statements#tilde|here]].
==See also==
==See also==
{{Template:Unicode:UnicodeToUpper and UnicodeToLower footer}}
{{Template:Unicode:UnicodeToUpper and UnicodeToLower footer}}

Revision as of 05:20, 25 February 2011

Translate to uppercase/lowercase (Unicode class)


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-for-one character translation, which will fail to correctly handle unusual characters whose uppercase versions have two-characters.

Syntax

%outUnicode = unicode:UnicodeToUpper

%outUnicode = unicode:UnicodeToLower

Syntax terms

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

Usage Notes

  • UnicodeToUpper / UnicodeToLower are available as of "Sirius Mods" Version 7.7.

Examples

  1. The following code fragment:

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

    Will produce:

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

See also