Skip to content

Commit 70ba355

Browse files
committed
Handle special characters
1 parent 9d04d7b commit 70ba355

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

bin/us_counties.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
p_data = Path('data')
77

88
reader = csv.reader(p_data.joinpath('us_counties.txt').open())
9+
next(reader) # skip header row
910

1011
state_name_idx = 0
1112
state_fips_idx = 1
@@ -23,4 +24,5 @@
2324
}
2425
)
2526

26-
p_data.joinpath('us_counties.json').write_text(json.dumps(counties))
27+
# need ensure_ascii=False to handle special characters (for PR counties)
28+
p_data.joinpath('us_counties.json').write_text(json.dumps(counties, ensure_ascii=False))

0 commit comments

Comments
 (0)