Add encoding and properly dump headers
Add encoding and properly dump headers

jeffreyliu3230/scrapi,mehanig/scrapi,felliott/scrapi,alexgarciac/scrapi,fabianvf/scrapi,icereval/scrapi,ostwald/scrapi,felliott/scrapi,fabianvf/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi,erinspace/scrapi,mehanig/scrapi,CenterForOpenScience/scrapi