Template:Chset-ctrl4/doc


Note

edit

This template replaces Template:chset-ctrl and is an enhancement of Template:chset-ctrl3, additionally displaying the code point in octal.

Usage

edit

Used with Template:chset-tableformat to indicate a table cell for a control character or non-printing punctuation character.

  • Parameter 1: hhhh, Hexadecimal Unicode value, 4 digits (e.g., 0020)
  • Parameter 2: X, Control character name (e.g., SP), with link to appropriate article
  • Parameter 3: dd, Decimal character code, 1–3 digits (e.g., 32)
  • Parameter 4: ooo, Octal character code, 3 digits (e.g., 040)

For example, the first four ASCII control characters (Unicode U+0000 thru U+0003, decimal 0 through 3, octal 000 through 003) are coded as rows in a character set table like this:

{|
|{{chset-color-ctrl}}|{{chset-ctrl4|0000|[[Null character|NUL]]|0|000}}
|{{chset-color-ctrl}}|{{chset-ctrl4|0001|[[Start of heading|SOH]]|1|001}}
|{{chset-color-ctrl}}|{{chset-ctrl4|0002|[[Start of text|STX]]|2|002}}
|{{chset-color-ctrl}}|{{chset-ctrl4|0003|[[End of text|ETX]]|3|003}}
|}

Which yields:

NUL
0000
0
000
SOH
0001
1
001
STX
0002
2
002
ETX
0003
3
003

Another example illustrates the coding for a few of the ISO/IEC non-printing punctuation characters:

{|
|{{chset-color-misc}}|{{chset-ctrl4|0020|[[Space (character)|SP]]|32|040}}
|{{chset-color-misc}}|{{chset-ctrl4|00A0|[[Non-breaking space|NBSP]]|160|240}}
|{{chset-color-ctrl}}|{{chset-ctrl4|00AD|[[Soft hyphen|SHY]]|173|255}}
|}

Which yields:

SP
0020
32
040
NBSP
00A0
160
240
SHY
00AD
173
255

Chset family of templates

edit

See ISO 8859-1, Windows-1252, and EBCDIC for examples of usage.

edit

Character row header

edit

Character cell colors

edit

For generating colours for cells by Unicode category, this script may be helpful.

Certain colours are in the process of being phased out:

  • Template:chset-color-ext-punct — Extended punctuation character cell color. Intended to represent non-ASCII punctuation, this is not a category used by Unicode (and there are no corresponding ext-digit, ext-graph etc). Currently renders the same as punct.

In addition to these, boxed and slightly shaded variants of these exist in order to indicate some kind of additional information (depending on the article) like, for example, a derivation from a base codepage, a variance of definition of the corresponding codepage in different sources (to be explained in the article) or in different revisions of a code page:

and

Please note that the boxed variants must not be used, if a cell, which is not to be marked, is surrounded by four cells, which need to be marked, as this would make the central cell appear marked as well. The shaded variants do not exhibit this problem.

For as long as there is no need to differentiate one or a few of the cells in a group from the other cells in the same group, refer to the normal (that is, the non-"box"- or "var"-type) templates further above.

Character cell contents

edit