Added encoding argument