Rework country name <-> ISO code mapping KContacts
Open, NormalPublic

Description

This relies on an external file that apparently was generated many many years ago with a long-lost script. The data in there is outdated and not optimized for fast lookup.

This could be replaced by a new generator consuming CLDR data and outputting static data that can be compiled in and allows allocation-free in-place lookup.

vkrause created this task.May 24 2018, 3:42 PM
vkrause triaged this task as Normal priority.

After reading my kcontacts code, the file and the file generated from countrieslistcldr.git's generate app, besides the fact that the file is 10 times bigger because 10 times as much data, there might be an issue that in the "original" file, it seems to be english first, then other languages, for each country. I haven't reproduced that part of it.

For ISO to localized country name mapping, there's "iso-codes", providing .mo files for country names (among other stuff), trivial to integrate (i18nd("iso_3166-1", strbuf.leftRef(pos).toUtf8().constData());), and that's already used elsewhere. So we just need to look at an optimized way to map country names to ISO codes.

vkrause moved this task from Actionable to In Progress on the KDE Itinerary board.Aug 2 2018, 5:07 PM

The Country -> ISO direction is addressed in D14563.

D15173 has the last part of this.

vkrause moved this task from In Progress to Done on the KDE Itinerary board.Sep 15 2018, 9:16 AM