fix encoding in typeids