0
0
mirror of https://github.com/lipis/flag-icons.git synced 2024-11-21 10:28:56 +01:00

Fix encoding and sort by name in country.json (#1031)

This commit is contained in:
Lipis 2022-08-24 20:38:07 +03:00 committed by GitHub
parent 17ba28d745
commit df12d5c6fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1424 additions and 1424 deletions

File diff suppressed because it is too large Load Diff

View File

@ -12,11 +12,11 @@ file_codes = [name.replace(".svg", "") for name in files]
country_json = open("country.json")
flags = json.load(country_json)
flags.sort(key=lambda x: x["code"])
flags.sort(key=lambda x: x["name"])
country_codes = [flag["code"] for flag in flags]
with open("country.json", "w") as output:
json.dump(flags, output, indent=2, sort_keys=True)
with open("country.json", "w", encoding='utf8') as output:
json.dump(flags, output, indent=2, sort_keys=True, ensure_ascii=False)
all_good = True