mirror of
https://github.com/lipis/flag-icons.git
synced 2024-11-21 18:38:57 +01:00
Fix encoding and sort by name in country.json
(#1031)
This commit is contained in:
parent
17ba28d745
commit
df12d5c6fe
2842
country.json
2842
country.json
File diff suppressed because it is too large
Load Diff
6
flags.py
6
flags.py
@ -12,11 +12,11 @@ file_codes = [name.replace(".svg", "") for name in files]
|
|||||||
|
|
||||||
country_json = open("country.json")
|
country_json = open("country.json")
|
||||||
flags = json.load(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]
|
country_codes = [flag["code"] for flag in flags]
|
||||||
|
|
||||||
with open("country.json", "w") as output:
|
with open("country.json", "w", encoding='utf8') as output:
|
||||||
json.dump(flags, output, indent=2, sort_keys=True)
|
json.dump(flags, output, indent=2, sort_keys=True, ensure_ascii=False)
|
||||||
|
|
||||||
all_good = True
|
all_good = True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user