This template uses Lua: |
This template produces a formatted description of a Unicode character, to be used inline or otherwise with regular text.
The character {{unichar|a9}}
is about intellectual property.
→
The {{unichar}} template takes the Unicode hexadecimal code point value as input. Thus, for example, {{unichar|00A9}}
→ U+00A9 © COPYRIGHT SIGN.
This template produces a formatted description of a Unicode character, to be used in-line with regular text. It follows the standard Unicode presentation of a character, using the "U+" prefix for displaying the hex code point, followed by its glyph, then optionally by the character name, using Unicode's inline formatting recommendation. In running text such as the Unicode Standard, Wikipedia, or other rich-text environments, the character name is preferredly displayed in SMALL-CAPS STYLE. (The all-caps presentation is mainly designed for plain-text environments.)
The hexadecimal value is required (e.g. A9), other input is optional. The actual glyph is rendered using a font that contains the character. This can be set to something more specific, e.g. to language- or IPA-specific fonts. To show the glyph, the font character can be overridden with an image. A wikilink to an article on the character or set of characters, and another to the article Unicode can be created. It is also possible to add (bracketed like this), the calculated decimal value, HTML character codes, and a custom note.
Some special code points are given extra care, like control and space characters. These are handled automatically (by the unichar/gc
sub-template) without user intervention.
{{unichar|00A9}}
→ U+00A9 © COPYRIGHT SIGN{{unichar|00A9|nlink=}}
→ U+00A9 © COPYRIGHT SIGN{{unichar|00A9|nlink=|note={{crossref|See also [[Copyleft]] symbol}}}}
→ U+00A9 © COPYRIGHT SIGN ( ){{unichar|00A9|nlink=|html=}}
→ U+00A9 © COPYRIGHT SIGN (©, ©){{unichar|030D|cwith=◌}}
→ U+030D ◌̍ COMBINING VERTICAL LINE ABOVE – combined with a dotted circle{{unichar|030D|cwith=◌}}
→ U+030D ◌̍ COMBINING VERTICAL LINE ABOVE – combined with a dotted circle{{unichar|4E95|note=[[Jingtian]]}}
→ U+4E95 井 CJK UNIFIED IDEOGRAPH-4E95 (Jingtian)The blank template, with all parameters, is as follows:
{{unichar
| ulink =
| image =
| cwith =
| size =
| use =
| use2 =
| nlink =
| html =
| note =
| name =
| alias =
}}
Inline version:
{{unichar| <!--hex value (do not add "U+")-->|ulink= |image= |cwith= |size= |use= |use2= |nlink= |html= |note= }}
00A9
.
A9
, a9
and 00A9
as hexadecimal value. Decimal values are not detected being decimal, and will give unexpected results .{{unichar|00A9|nlink=Copyright symbol}}
→ U+00A9 © COPYRIGHT SIGNnlink=wikt:<target article>
, which may be appropriate if there is no suitable Wikipedia article. For example:{{unichar|204A|nlink=wikt:⁊}}
→ U+204A ⁊ TIRONIAN SIGN ET|nlink=
, blank with no value), the link points to the character itself except when that causes a problem with WP:NCTR in which case the name of the character is used or an error is produced if no such name exists (see § Presentation effects).
{{unichar|00A9|nlink=}}
→ U+00A9 © COPYRIGHT SIGN is equivalent to {{unichar|00A9|nlink=©}}
.|cwith=◌
, the character will be combined with the placeholder symbol, U+25CC ◌ DOTTED CIRCLE.
|cwith=
:
{{unichar|0485}}
→ U+0485 ҅ COMBINING CYRILLIC DASIA PNEUMATA|cwith=
with dotted circle:
{{unichar|0485|cwith=◌}}
→ U+0485 ◌҅ COMBINING CYRILLIC DASIA PNEUMATA or{{unichar|0485|cwith=◌}}
→ U+0485 ◌҅ COMBINING CYRILLIC DASIA PNEUMATAcwith=◌◌
does not provide the desired result if the intention is to display a diacritic that spans two characters (such as those in the range U+035C to U+0362): the diacritic will be offset. In such cases, editors must emulate the template output by hand, because the correct HTML sequence is "first-character + combining-diacritic + second-character". Thus, for example, to show the combining double tilde U+0360, write U+0360 ◌͠◌
then (in {{small}}), COMBINING DOUBLE TILDE. This produces U+0360 ◌͠◌ COMBINING DOUBLE TILDE.|cwith=
is deprecated; this restriction is not currently enforced but if any other character is used, the output (grapheme and description) is at best misleading.|html=
, blank.note=
option permits an added comment such as U+4E95 井 CJK UNIFIED IDEOGRAPH-4E95 (Jingtian)|ulink=
, blank with no value), the article Unicode is used as the default value in the output: [[Unicode|U+]] producing U+. This only needs to change if you have a reason to link elsewhere than Unicode, e.g. to an article on a subset of Unicode characters.{{unicode}}
, other options are {{IPA}}
, {{lang}}
and {{script}}
.|use=lang
or |use=script
, |use2=
should be used to set the language (e.g. |use2=fr
) or the script (e.g. |use2=Cyrs
). A glyph may still not show as expected due to browser effects. For a detailed description, see each template's documentation.
{{unichar|0485|cwith=|use=script|use2=Cyrs}}
→ U+0485 ҅ COMBINING CYRILLIC DASIA PNEUMATA{{unichar|0041|size=2em}}
→ U+0041 A LATIN CAPITAL LETTER A{{unichar
| A9
| ulink = Universal Character Set characters
| image =
| size = 150%
| nlink = Copyright symbol
| note = Example
}}
Since this template is aimed at presenting a formatted, inline description, some effects are introduced to sustain this target.
U+00A0 NO-BREAK SPACE
.
�A0;
(NBSP) to prevent wiki-markup deleting it as repeated spaces.<control>
or <control-0007>
<surrogate>
or <surrogate-D800>
<private-use>
or <private-use-E000>
<not-a-character>
, <non-character>
or <not-a-character-FFFE>
The second parameter (Unicode name) is not presented, since it cannot exist. It is possible to create a link to an article.
|1=
(or first unnamed parameter), the hex value, is missing, empty, or invalid.|nlink=
will be directly to the article (entered in a form like |nlink=Bell signal
). A blank value of just |
cannot work for <label-hhhh> characters (there is no character name at all to make into a link). This produces an error.|1=98
will be read as being hexadecimal value 0098. There is no way that the template can detect you intended to enter 9810=6216. No warning is issued, and the wrong character, U+009816, will be shown (not U+0062).alias=
cannot be used to create an unofficial alias.alias=yes
is used but the code point does not have an official alias, no name whatever will be displayed.nlink=
should be the normal name of an article. Do not type it in all caps as a red link will result.The string "unichar" is used only in English Wikipedia, as a name for this template. It has no meaning outside this context.
The template uses these subtemplates:
{{unichar}}
. Calls several subtemplates to produce the textstrings, and then strings them together. Also checks for the error non-hex input.|image=
, which overrides the font. Also processes |use=
, |use2=
, |size=
, |cwith=
.|nlink=
to create a piped wikilink to an article. When the general category (gc) is special, the name will change into a <label-hhhh>.|html=
named entity like if that exists, using {{#invoke:LoadData|Numcr2namecr}}
); and the free-text |note=
.<#salted#>
is used internally to pass through a non-defined input parameter. This value is correct when about the Unicode name, because it cannot have the characters <##>, and so salted is the right word (meaning uninhibitable). For ease of code maintenance, it is used in various places in the code.{{#invoke:LoadData|Numcr2namecr|0x22C1}}
→ ⋁, ⋁, ⋁|use-script=
, then |use2=
needs lowercase (e.g. 0485, Cyrs or cyrs)[clarification needed]Key to the Unicode Code Charts (Ch 24)[1] | |||
---|---|---|---|
Symbol | Meaning | Examples | |
※ | Character name alias | ※ LATIN SMALL LETTER GHA | |
= | Informative alias(es) | = barred o, o bar | |
• | Informative note |
| |
→ | Cross-reference | → 0283 ʃ latin small letter esh | |
≡ | Canonical decomposition mapping | ≡ 0075 u 031B ◌̛ | |
≈ | Compatibility decomposition mapping | ≈ 006E n 006A j | |
~ | Standardized variation sequence | ~ 2205 FE00 zero with long diagonal stroke overlay form |
TemplateData for Unichar
Template data
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Formats a Unicode character description inline.
|
Useful links for researching Unicode characters: