CharacterPosition (CharacterTranslationException property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (match syntax table to syntax template, tags and edits)
Line 1: Line 1:
{{Template:CharacterTranslationException:CharacterPosition subtitle}}
{{Template:CharacterTranslationException:CharacterPosition subtitle}}
==Syntax==
==Syntax==
{{Template:CharacterTranslationException:CharacterPosition syntax}}
{{Template:CharacterTranslationException:CharacterPosition syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%num</th>
<tr><th>%number</th>
<td>The position of the character at which the exception was thrown.
<td>The position of the character at which the exception was thrown.
</td></tr>
</td></tr>
<tr><th>%chTransEx</th>
<tr><th>characterTranslationException</th>
<td>A reference to an instance of a CharacterTranslationException object.
<td>A reference to an instance of a <var>[[CharacterTranslationException_class|CharacterTranslationException]]</var> object.


</td></tr></table>
</td></tr></table>
Line 18: Line 17:
<ul>
<ul>
<li>If EBCDIC, one byte corresponds to one character.
<li>If EBCDIC, one byte corresponds to one character.
<li>If Unicode, two bytes correspond to one character.
<li>If [[Unicode]], two bytes correspond to one character.
<li>If UTF-16, two bytes correspond to one character.
<li>If UTF-16, two bytes correspond to one character.
<li>If UTF-8, the relationship between bytes and characters is
<li>If UTF-8, the relationship between bytes and characters is

Revision as of 05:25, 15 April 2011

Position of character at which the exception was thrown (CharacterTranslationException class)

Syntax

%number = characterTranslationException:CharacterPosition

Syntax terms

%number The position of the character at which the exception was thrown.
characterTranslationException A reference to an instance of a CharacterTranslationException object.

Usage notes

  • The number of bytes that constitute a character depends on the type of string that causes the exception:
    • If EBCDIC, one byte corresponds to one character.
    • If Unicode, two bytes correspond to one character.
    • If UTF-16, two bytes correspond to one character.
    • If UTF-8, the relationship between bytes and characters is variable, depending on the code points.

See also