[KCharSelect] Port generate-datafile.py to Python 3
- Add missing parentheses for print()
- Writing strings to the data file requires encode()
- Replace "map.has_key(key)" with "key in map"
Reviewed by: lbeltrame
Differential Revision: https://phabricator.kde.org/D13641