Switched encoding-parameter from String to Charset to make it more fool proof