[+FIX] trim category values before encoding them