Encode string before writing (to be Python 3 friendly)
Use a separate dictionary when stripping icon prefixes
Use float numbers when calculating icon position

(This way we get the same results in Python 2 and 3.)