Make sure encoding exists before applying it