added options to get encoding and defaulting to utf-8