Crates.io | country-emoji |
lib.rs | country-emoji |
version | 0.2.0 |
source | src |
created_at | 2020-10-26 07:35:11.736708 |
updated_at | 2021-11-27 22:48:39.155714 |
description | Converts between country names, ISO 3166-1 codes and flag emojis. |
homepage | |
repository | https://github.com/leodutra/country-emoji |
max_upload_size | |
id | 305514 |
size | 26,043 |
Converts between country names, ISO 3166-1 codes and flag emojis.
use country_emoji::{flag, code, name, countries};
flag("CL")
// ~> ๐จ๐ฑ
code("๐จ๐ฆ")
// ~> CA
name("๐ถ๐ฆ")
// ~> Qatar
// can extract name from stringโฆ
flag("Taiwan number one!")
// ~> ๐น๐ผ
// โฆbut only if there"s no ambiguity
flag("Congo and Burma")
// ~> undefined
flag("Republic of Tanzania")
// ~> ๐น๐ฟ
flag("Tanzania, United Republic of")
// ~> ๐น๐ฟ
code("Australia")
// ~> AU
code("UAE")
// ~> AE
name("AE")
// ~> United Arab Emirates
code("UK")
// ~> GB
Check out the following:
If you discover a bug please report it here. Express gratitude here.
Mail me at leodutra.br+foss@gmail.com, or on twitter @leodutra.
This library is based on the work of two existing library:
Thanks guys for your work!
MIT @ Leo Dutra