attempt function pre_encode