protect encode against ints