NXP-12644: use specific encoding functions in templates