Cldr.flag
You're seeing just the function
flag
, go back to Cldr module for more information.
Returns a unicode string representing a flag for a territory.
Options
territory
is any valid territory code returned byCldr.known_territories/0
or aCldr.LanguageTag.t
Returns
A string representing a flag or
An empty string if the territory is valid but no unicode grapheme is defined. This is true for territories that are aggregate areas such as "the world" which is
:001
{:error, {Cldr.UnknownTerritoryError, message}}
Notes
- If a
Cldr.LanguageTag.t
is provided, the territory is determined byCldr.Locale.territory_from_locale/1
Examples
iex> Cldr.flag :AU
"π¦πΊ"
iex> Cldr.flag :US
"πΊπΈ"
iex> Cldr.flag "UN"
"πΊπ³"
iex> Cldr.flag :UK
{:error, {Cldr.UnknownTerritoryError, "The territory :UK is unknown"}}