It seem there's no problems to write the mastheights keymap or whatever it's called in python, with a key containing a special char :
so I would bet that's the reading that's causing problems. Maybe you could have one more param, numeric, in rostersea : params = [ classname[ 1 ], classname[ 0 ], n ], then, at display time, get the correspondancy between unit[0] and unit[2] and read mastheights[unit[2]] instead of mastheights[unit[0]] ?