Jump to content

Template:Charmap/doc

From Simple English Wikipedia, the free encyclopedia

Template creates a standard computer encoding table for writing system character articles. It is based on the tables of Computing Codes placed on most Cyrillic letter pages by User:Coroboy.

{{charmap
| 1st character Unicode code point
| 2nd character Unicode code point
...
| 10th character Unicode code point

| image1 = alternate picture for 1st character
| image2 = alternate picture for 2nd character
...
| image10 = alternate picture for 10th character

| size = character text size
| size1 = text size for 1st character
| size2 = text size for 2nd character
...
| size10 = text size for 10th character

| name1 = 1st character name
| name2 = 2nd character name
...
| name10 = 10th character name

| map1 = 1st alternate encoding name
| map1char1 = 1st character code in 1st alternate encoding
| map1char2 = 2nd character code in 1st alternate encoding
...
| map1char10 = 10th character code in 1st alternate encoding
...
| map2 = 2nd alternate encoding name
...
| map10 = 10th alternate encoding name
...
| map10char10 = 10th character code in 10th alternate encoding

| namedref1 = 1st named character reference
| ref1char1 = 1st character code in 1st named character reference
| ref1char2 = 2nd character code in 1st named character reference
...
| ref1char10 = 10th character code in 1st named character reference
...
| namedref2 = 2nd named character reference
...
| namedref5 = 5th named character reference
...
| ref5char10 = 10th character code in 5th named character reference

| Info = yes/no flag for link to fileformat.info character data (default "no")
| Info1 = yes/no flag for link to fileformat.info data for first character only
| Info2 = yes/no flag for link to fileformat.info data for second character only
...
| IncludeGB = yes/no flag (default no) for displaying a GB 18030 code in addition to UTF-8 and (if applicable) UTF-16
}}

All character codes should be entered as bare hexadecimal numbers, ie Unicode code points should not be preceded by "U+" and decimal convention encodings should still specify code points by hex value. Hex characters are case insensitive, and will always appear in the template as capitalized code points, no matter the casing of the input. HTML named character references are automatically generated, but any other named character references must be explicitly listed, with any special characters specified using the standard HTML &xxx; format.

All defined characters must be given a character name in order for the table to display that column. Characters not represented in a particular alternate encoding should have a blank or undefined parameter for that encoding.

For double byte, or other two code-unit encodings, each of the bytes can be separately converted to decimal if the code units are separated with a space. Greater than two code-unit input will erroneously convert only the first and last to decimal.

Currently, each field (including the Unicode code point) can contain up to four hexadecimal numbers to be converted to decimal, separated by spaces. This is because a variable width encoding might use up to four bytes (e.g. EUC-TW), and because some characters in other encodings correspond to a sequence of characters in Unicode (some of which are Unicode Standard Annex UAX #34 named sequences with their own normative Unicode names; see for the entire list). For an example of both multiple encoding bytes and multiple Unicode code points being used, see Se (kana).

Examples

[change source]

Example with automatic XML named character references, explicit named reference, single and double byte character mappings, alternate image, and mixed casing of inputs.

{{charmap 
| 0398 | name1 = Greek Capital Letter Theta
| 3b8 | name2 = Greek Small Letter Theta | image2=[[File:Greek lc theta icon.svg|10px]]
| map1 = [[ISO 8859-7]] | map1char1 = c8 | map1char2 = E8
| map2 = [[Code page 737|CP 737]] (MS-DOS Greek) | map2char1 = 87 | map2char2 = 9F
| map3 = [[Code page 860|CP 860]], [[Code page 861|861]], [[Code page 862|862]], [[Code page 863|863]], [[Code page 865|865]] | map3char1 = E9
| map4 = [[Code page 869|CP 869]] (MS-DOS Greek 2) | map4char1 = Ac | map4char2 = E2
| map5 = EBCDIC 875 | map5char1 = 48 | map5char2 = 9B
| map6 = [[GSM 03.38]] | map6char1 = 19
| map7 = [[TI calculator character sets#TI-86|TI-86]] | map7char2 = c1
| map8 = [[Shift JIS]] | map8char1 = 83 A6 | map8char2 = 83 C6
| namedref1 = [[TeX]] | ref1char1 = \Theta | ref1char2 = \theta
| Info1 = yes | IncludeGB = yes }}
Character information
PreviewΘ
Unicode name GREEK CAPITAL LETTER THETA GREEK SMALL LETTER THETA
Encodingsdecimalhexdechex
Unicode920U+0398952U+03B8
UTF-8206 152CE 98206 184CE B8
GB 18030166 168A6 A8166 200A6 C8
Numeric character referenceΘΘθθ
Named character referenceΘθ
ISO 8859-7200C8232E8
CP 737 (MS-DOS Greek)135871599F
CP 860, 861, 862, 863, 865233E9
CP 869 (MS-DOS Greek 2)172AC226E2
EBCDIC 87572481559B
GSM 03.382519
TI-86193C1
Shift JIS131 16683 A6131 19883 C6
TeX\Theta\theta


Example with automatic UTF-16 mappings, but no XML named character reference.

{{charmap 
| 2C90 | name1 = Coptic Capital Letter Thethe
| 2C91 | name2 = Coptic Small Letter Thethe
| 10338 | name3 = Gothic Letter Thuth|size3 = 100%
| size = 200% | Info = yes | Info3 = no
}}
Character information
Preview𐌸
Unicode name COPTIC CAPITAL LETTER THETHE COPTIC SMALL LETTER THETHE GOTHIC LETTER THUTH
Encodingsdecimalhexdechexdechex
Unicode11408U+2C9011409U+2C9166360U+10338
UTF-8226 178 144E2 B2 90226 178 145E2 B2 91240 144 140 184F0 90 8C B8
UTF-16114082C90114092C9155296 57144D800 DF38
Numeric character referenceⲐⲐⲑⲑ𐌸𐌸

Dependencies

[change source]

This template is dependent on the following transcluded templates:

TemplateData

[change source]
TemplateData documentation used by VisualEditor and other tools
See a monthly parameter usage report for Template:Charmap in articles based on its TemplateData.

TemplateData for Charmap

Display data about a Unicode character in a table

Template parameters

This template has custom formatting.

ParameterDescriptionTypeStatus
Unicode codepoint 11

The first Unicode codepoint for the character(s)

Stringoptional
Name 1name1

The first name for the character(s)

Stringoptional
Unicode codepoint 22

The second Unicode codepoint for the character(s)

Stringoptional
Name 2name2

The second name for the character(s)

Stringoptional