migueldeicaza / CovidGraphs

Covid Graphs app
MIT License
93 stars 11 forks source link

Small internationalization improvements #30

Closed krubenok closed 3 years ago

krubenok commented 3 years ago

For international locations where the URL contains some URL unfriendly characters, add URL encoding before fetching data from the server and change how the list is pre-populated to support such locations.

As it turns out, it doesn't seem like addingPercentEncoding has a set of allowable characters that neatly matches URL encoding so I needed to create a custom set. Perhaps I'm just being dense and missing the correct one...

Tested against "British Columbia, Canada" and "Quebec, Canada" and a handful of others.

n.b. I'm a total Swift noob so please correct me on best practices!