CharacterToUnicode (String function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Template:String:CharacterToUnicode subtitle}}
{{Template:String:CharacterToUnicode subtitle}}
 
<var>CharacterToUnicode</var> takes a string input and outputs a copy of it in which any of the input characters that are also specified in a <var>[[CharacterToUnicodeMap class|CharacterToUnicodeMap]]</var> object are replaced with the characters to which they are mapped by the object. A <var>CharacterToUnicodeMap</var> object maps code points in a character set to corresponding <var>Unicode</var> characters.  
<var>CharacterToUnicode</var> takes a string input and outputs a copy of it in which any of the input characters that are also specified in a <var>CharacterToUnicodeMap</var> object are replaced with the characters to which they are mapped by the object. A <var>[[CharacterToUnicodeMap class|CharacterToUnicodeMap]]</var> object maps code points in a character set to corresponding <var>Unicode</var> characters.  


==Syntax==
==Syntax==
Line 10: Line 9:
<tr><th>%unicode</th>
<tr><th>%unicode</th>
<td>A <var>Unicode</var> string variable to receive the <var>Unicode</var> character mapped to the method object <var class="term">string</var>.</td></tr>
<td>A <var>Unicode</var> string variable to receive the <var>Unicode</var> character mapped to the method object <var class="term">string</var>.</td></tr>
<tr><th>string</th>
<tr><th>string</th>
<td>A string of characters to be individually converted to the <var>Unicode</var> characters to which they are mapped in the <var class="term">characterToUnicodeMap</var> object. </td></tr>
<td>A string of characters to be individually converted to the <var>Unicode</var> characters to which they are mapped in the <var class="term">characterToUnicodeMap</var> object. </td></tr>
<tr><th>characterToUnicodeMap</th>
<tr><th>characterToUnicodeMap</th>
<td><var>A CharacterToUnicodeMap</var> object.</td></tr>
<td><var>A CharacterToUnicodeMap</var> object.</td></tr>

Latest revision as of 20:53, 3 September 2015

Translate characters to unicode (String class)

[Introduced in Sirius Mods 8.0]

CharacterToUnicode takes a string input and outputs a copy of it in which any of the input characters that are also specified in a CharacterToUnicodeMap object are replaced with the characters to which they are mapped by the object. A CharacterToUnicodeMap object maps code points in a character set to corresponding Unicode characters.

Syntax

%unicode = string:CharacterToUnicode( characterToUnicodeMap) Throws CharacterTranslationException

Syntax terms

%unicode A Unicode string variable to receive the Unicode character mapped to the method object string.
string A string of characters to be individually converted to the Unicode characters to which they are mapped in the characterToUnicodeMap object.
characterToUnicodeMap A CharacterToUnicodeMap object.

Usage notes

  • If the string method object contains a character that is not present in characterToUnicodeMap, a CharacterTranslationException exception is returned.

Examples

See the CharacterToUnicodeMap class example.

See also