Template:Unicode/doc: Difference between revisions

Content deleted Content added
hex & dec examples
add doc for revised template
 
(84 intermediate revisions by 37 users not shown)
Line 1:
{{documentationDocumentation subpage}}
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->
{{TOCright}}
==Usage==
The template loooks for letter font families that are broadly supporting incurrent characters (symbols, characters). Inpiut can be decimal like <tt>&amp;#123;</tt> or hexadecimal <tt>&amp;#A9:</tt>. E.g. (mind the 'x' for hex values):
* {{code|<nowiki>{{unicode|&amp;#x22CA;}}</nowiki>}} --> {{unicode|&#x22CA;}}
* {{code|<nowiki>{{unicode|&amp;#8906;}}</nowiki>}} --> {{unicode|&#8906;}}
or
* {{code|<nowiki>{{unicode|&amp;#x22C9;}}</nowiki>}} --> {{unicode|&#x22C9;}}
* {{code|<nowiki>{{unicode|&amp;#8905;}}</nowiki>}} --> {{unicode|&#8905;}}
 
'''Template:Unicode''' was created to improve the presentation of Unicode characters on some very old browsers (especially IE6). It took one parameter, which was a string which could contain Unicode characters beyond the ASCII subset. It simply passed through its parameter for most browsers, but for older browsers could add HTML code to improve that browser's presentation of the characters.
==Purpose==
This template was created to allow easy switching to [[unicode font]]s. It should ''only'' be used in cases where characters do otherwise not render correctly on some browsers, such as [[Microsoft]] [[Internet Explorer]].
 
After IE6 was deemed too old to support, this template [[Template talk:Unicode|was deprecated]], and its implementation was made into a pure identity function, just passing through its parameter. Usages of the template were removed from all articles; the template had been used on at least 60,000 to 100,000 articles.
The fonts selected are designed to maximize the probability to render uncommon Unicode characters correctly. However, different fonts cover different [[Mapping of Unicode characters|Unicode ranges]]. It is probably mostly useful for various [[Unicode symbols]]. Do not use it for the following:
 
Sometime after that, this template was changed again, to start showing a list of other templates that might be of interest (in the form of a so-called "template disambiguation"). This had the unfortunate effect of breaking the displayability of millions of old revisions of tens of thousands of articles. (The template change replaced a string or single unicode character in the displayed revision with a large mass of unrelated text, plus error messages, at each place the template was used in the old article revision.)
*For strings in the [[International Phonetic Alphabet]], use {{tl|IPA}}.
*for various non-Latin scripts, use {{tl|lang}} if possible, or {{tl|script}} otherwise.
*for [[MUFI]] encoding (non-Unicode), use {{tl|mufi}}.
 
To correct that problem, the template was made into the current form, which again passes through its parameter when invoked but also when the template page itself is viewed shows the list of other templates of interest.
==Guts of template==
<code><nowiki><span class="Unicode">{{{1}}}</span></nowiki></code>
 
...wherein class="Unicode" is defined in [[MediaWiki:Common.css/WinFixes.css]]:
<source lang="CSS">
.Unicode {
font-family: Code2000, Code2001, "Free Serif", "TITUS Cyberbit Basic",
"Doulos SIL", "Chrysanthi Unicode", "Bitstream Cyberbit",
"Bitstream CyberBase", Thryomanes, Gentium, GentiumAlt,
"Lucida Grande", "Free Sans", "Arial Unicode MS",
"Microsoft Sans Serif", "Lucida Sans Unicode";
}
</source>
 
A personal stylesheet (/monobook.css &c, class ''.Unicode'') may be used to enforce a "prettier" display where preferred.
 
== See also ==
* {{tl|IPA}} &mdash; International Phonetic Alphabet.
* {{tl|mufi}} &mdash; Forces a font which supports the [[MUFI]] characters.
* {{tl|transl}} &mdash; generic [[romanization]]
* {{tl|script}} &mdash; Scripts in Unicode navigation box
* {{tl|Unicode navigation}} &mdash; General Unicode navigation box
* {{tl|Table Unicode}} &mdash; General Unicode navigation box (deprecated)
 
<includeonly>
<!-- Categories below this line; interwikis at Wikidata -->
<!-- ADD CATEGORIES BELOW THIS LINE -->
 
[[Category:MSIE font fix templates|{{PAGENAME}}]]
 
<!-- ADD INTERWIKIS BELOW THIS LINE -->
 
[[ar:قالب:يونيكود]]
[[be-x-old:Шаблён:Юнікод]]
[[bg:Шаблон:Уникод]]
[[de:Vorlage:Unicode]]
[[dsb:Pśedłoga:Unicode]]
[[es:Plantilla:Unicode]]
[[eo:Ŝablono:Unicode]]
[[ko:틀:Unicode]]
[[hsb:Předłoha:Unicode]]
[[hr:Predložak:Unicode]]
[[it:Template:Unicode]]
[[mk:Шаблон:Уникод]]
[[nl:Sjabloon:Unicode]]
[[pl:Szablon:Unicode]]
[[pnt:Πρότυπον:Unicode]]
[[pt:Predefinição:Unicode]]
[[ro:Format:Unicode]]
[[ru:Шаблон:Unicode]]
[[sq:Stampa:Unicode]]
[[simple:Template:Unicode]]
[[fi:Malline:Unicode]]
[[vi:Tiêu bản:Unicode]]
[[zh:Template:Unicode]]
 
</includeonly>