add support for encoding and file extension for csv export