Module:Char/doc

From OpenStreetMap Wiki
Jump to navigation Jump to search

Usage

char

char(…) takes a variable number of arguments. Each argument is a Unicode codepoint number, which may be expressed in either decimal or hexadecimal form (such as 0x1ec5). The function converts each codepoint number into the corresponding character and concatenates the characters. This function can be used as a workaround for the bug that this MediaWiki installation truncates page content at the first surrogate pair, affecting many emoji for instance. [1]

  • {{#invoke:char|char|0x1f3f3|0xfe0f|0x200d|0x1f308}} → 🏳️‍🌈

flag

flag(…) takes an ISO 3166-1 alpha-2 country code, other emoji flag sequence, or ISO 3166-2 region code and returns the corresponding emoji flag. Compared to {{Flagicon}}, this function is more accessible and has less impact on page loading time but potentially displays incorrectly on some devices. This function can be used to reduce the number of Wikimedia Commons images on the page, mitigating a bug where too many such images can cause the page to fail to load. [2]

  • {{#invoke:char|flag|GB}} → 🇬🇧
  • {{#invoke:char|flag|GB-WLS}} → 🏴󠁧󠁢󠁷󠁬󠁳󠁿
  • {{#invoke:char|flag|US}} → 🇺🇸
  • {{#invoke:char|flag|US-TX}} → 🏴󠁵󠁳󠁴󠁸󠁿
  • {{#invoke:char|flag|EU}} → 🇪🇺
  • {{#invoke:char|flag|UN}} → 🇺🇳

See also