add encoding config for template