UnicodeToUpper and UnicodeToLower (Unicode functions): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
 
(19 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<span style="font-size:120%; color:black"><b>String with lowercase characters changed to</b></span>
{{Template:Unicode:UnicodeToUpper and UnicodeToLower subtitle}}
[[Category:Intrinsic Unicode methods|UnicodeToUpper and UnicodeToLower functions]]
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.
[[Category:Intrinsic methods]]
<p>
<!--DPL?? Category:Intrinsic Unicode methods|UnicodeToUpper and UnicodeToLower functions: String with lowercase characters changed to-->
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 (<tt>?</tt>), is returned for characters that translate to an EBCDIC character that is not displayable.</p>
<!--DPL?? Category:Intrinsic methods|UnicodeToUpper and UnicodeToLower (Unicode functions): String with lowercase characters changed to-->
<p>
<!--DPL?? Category:System methods|UnicodeToUpper and UnicodeToLower (Unicode functions): String with lowercase characters changed to-->
These methods produce a one-for-one character translation, which will fail to correctly handle unusual characters whose uppercase versions have two-characters.</p>


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


Character references are returned for characters that do not
===Syntax terms===
translate to an EBCDIC character.
<table class="syntaxTable">
The default substitute for non-displayable characters
<tr><th>%outUnicode</th>
in your environment, say a question mark (<tt>?</tt>),
<td>A <var>Unicode</var> variable to receive the all-uppercase or all-lowercase <var>Unicode</var> characters. </td></tr>
is returned for characters that translate to an EBCDIC character that is not displayable.


These methods produce a one-character for one-character translation,
<tr><th>unicode</th>
which will fail to correctly handle unusual characters whose uppercase versions
<td>The input <var>Unicode</var> string.</td></tr>
have two-characters, for example.
</table>


These functions are available as of ''Sirius Mods'' version 7.7.
==Usage Notes==
===Syntax===
<ul>
  %outUni = unicode:UnicodeToUpper
<li><var>UnicodeToUpper</var> and <var>UnicodeToLower</var> are available as of <var class="product">Sirius Mods</var> Version 7.7.
</ul>


  %outUni = unicode:UnicodeToLower
==Examples==
====Syntax Terms====
The following code fragment:
<dl>
<p class="code">. . .
<dt><i>%outUni</i>
%u is unicode
<dd>A Unicode variable to receive the all-uppercase or
%u = '} abC5xyZ! &amp;#x394; &amp;#x531; &amp;#xDF;':[[U (String function)|U]]
all-lowercase Unicode characters.
[[Intrinsic classes#printtext|printText]] {[[Text and Html statements#tilde|~]]} = '{%u:UnicodetoUpper}'
<dt><i>unicode</i>
printText {~} = '{%u:UnicodetoLower}'
<dd>The input Unicode string.
. . .


</dl>
</p>
===Examples===
Will produce:
<p class="output">%u:UnicodeToUpper = '} ABC5XYZ! &amp;#x0394; &amp;#x0531; ?'
%u:UnicodeToLower = '} abc5xyz! &amp;#x03B4; &amp;#x0561; ?'
</p>


Example UnicodeToUpper and UnicodeToLower statements follow:
==See also==
    . . .
{{Template:Unicode:UnicodeToUpper and UnicodeToLower footer}}
    %u is unicode
    %u = '} abC5xyZ! &amp;#x394; &amp;#x531; &amp;#xDF;':u
    [[Intrinsic classes#printtext|printText]] {~} = '{%u:toUpper}'
    printText {~} = '{%u:toLower}'
    . . .
 
The results are:
<pre>
    %u:UnicodeToUpper = '} ABC5XYZ! &amp;#x0394; &amp;#x0531; ?'
    %u:UnicodeToLower = '} abc5xyz! &amp;#x03B4; &amp;#x0561; ?'
</pre>
 
The tilde (<tt>~</tt>) directive is described [[Text and Html statements#tilde|here]].

Latest revision as of 20:13, 6 November 2012

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 and UnicodeToLower are available as of Sirius Mods Version 7.7.

Examples

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