Content deleted Content added
→Compatibility issues: Minor wording Tags: Mobile edit Mobile web edit Advanced mobile edit |
m convert special characters found by Wikipedia:Typo Team/moss (via WP:JWB) |
||
(11 intermediate revisions by 11 users not shown) | |||
Line 1:
{{Short description|Common markup construct used in SGML, XML, and HTML}}
{{one source|date=February 2021}}
A '''numeric character reference''' ('''NCR''') is a common [[markup (computer programming)|markup]] construct used in [[SGML]] and SGML-derived markup languages such as [[HTML]] and [[XML]]. It consists of a short sequence of [[character (computing)|character]]s that, in turn, represents a single character. Since [[SGML|WebSgml]], [[XML]] and [[HTML 4]], the code points of the [[Universal Character Set]] (UCS) of [[Unicode]] are used. NCRs are typically used in order to represent characters that are not [[plain text#Encoding|directly encodable]] in a particular document (for example, because they are international characters that do not fit in the 8-bit [[Character encoding|character set]] being used, or because they have special syntactic meaning in the language). When the document is interpreted by a markup-aware reader, each NCR is treated as if it were the character it represents.
==Examples==
In SGML, HTML, and XML, the following are all valid numeric character references for the Greek capital letter Sigma
{| class="wikitable
|+ Numerical character reference of {{unichar|03A3|GREEK CAPITAL LETTER SIGMA}}<br/>(
|-
! [[Unicode#Upluslink|Unicode character]]
Line 24 ⟶ 25:
In SGML, HTML, and XML, the following are all valid numeric character references for the Latin capital letter AE
{| class="wikitable
|+ Numerical character reference of {{unichar|00C6|Latin capital letter AE}}
|-
Line 38 ⟶ 39:
In SGML, HTML, and XML, the following are all valid numeric character references for the Latin small letter sharp s ß
{| class="wikitable
|+ Numerical character reference of {{unichar|00DF|Latin small letter sharp s}}
|-
Line 176 ⟶ 177:
| U+005A || &#90; || &#x5A; || Z
|-
| U+005B || &#91; || &#x5B; ||
|-
| U+005C || &#92; || &#x5C; || \
|-
| U+005D || &#93; || &#x5D; ||
|-
| U+005E || &#94; || &#x5E; || ^
Line 240 ⟶ 241:
| U+007A || &#122; || &#x7A; || z
|-
| U+007B || &#123; || &#x7B; ||
|-
| U+007C || &#124; || &#x7C; ||
|-
| U+007D || &#125; || &#x7D; ||
|-
| U+007E || &#126; || &#x7E; || ~
Line 288 ⟶ 289:
For example, as mentioned above, the correct numeric character reference for the [[Euro sign]] "€" <code>U+20AC</code> when using [[Unicode]] is decimal <code>&#8364;</code> and hexadecimal <code>&#x20AC;</code>. However, if using tools supporting obsolete implementations of HTML, the reference <code>&#128;</code> (Euro sign in the [[CP-1252]] code page) or <code>&#164;</code> (Euro sign in [[ISO/IEC 8859-15]]) may work.
As another example, if some text was created originally using the [[MacRoman]] character set, the [[quotation mark
==See also==
Line 295 ⟶ 296:
==References==
{{Reflist}}
{{Unicode navigation}}
|