add encoding option for document