Add optional character encoding.

Make passing the required character encoding optional, and default to
UTF-8.

Signed-off-by: Matthias Nott <matthias.nott@sap.com>