cpd: fix #1144 CPD encoding argument has no effect

Make sure the encoding is set before creating the renderer
Merge pull request #27 from uncletall/pmd/5.0.x

cpd: fix #1144 CPD encoding argument has no effect
pmd: add changelog and test for #1144