encode once