Fix a test that assumed the system encoding was utf8 (and close a few resource leaks)
Fix a test that assumed the system encoding was utf8 (and close a few resource leaks)

ramiroluz/cookiecutter,0k/cookiecutter,jhermann/cookiecutter,cichm/cookiecutter,janusnic/cookiecutter,Vauxoo/cookiecutter,agconti/cookiecutter,jhermann/cookiecutter,letolab/cookiecutter,dajose/cookiecutter,nhomar/cookiecutter,cichm/cookiecutter,terryjbates/cookiecutter,dajose/cookiecutter,Vauxoo/cookiecutter,terryjbates/cookiecutter,foodszhang/cookiecutter,Springerle/cookiecutter,michaeljoseph/cookiecutter,vintasoftware/cookiecutter,ionelmc/cookiecutter,hackebrot/cookiecutter,audreyr/cookiecutter,pjbull/cookiecutter,willingc/cookiecutter,janusnic/cookiecutter,lgp171188/cookiecutter,lucius-feng/cookiecutter,takeflight/cookiecutter,tylerdave/cookiecutter,venumech/cookiecutter,nhomar/cookiecutter,vintasoftware/cookiecutter,Springerle/cookiecutter,cguardia/cookiecutter,atlassian/cookiecutter,luzfcb/cookiecutter,benthomasson/cookiecutter,willingc/cookiecutter,atlassian/cookiecutter,drgarcia1986/cookiecutter,vincentbernat/cookiecutter,lgp171188/cookiecutter,foodszhang/cookiecutter,michaeljoseph/cookiecutter,benthomasson/cookiecutter,kkujawinski/cookiecutter,audreyr/cookiecutter,ionelmc/cookiecutter,christabor/cookiecutter,pjbull/cookiecutter,lucius-feng/cookiecutter,drgarcia1986/cookiecutter,takeflight/cookiecutter,kkujawinski/cookiecutter,letolab/cookiecutter,hackebrot/cookiecutter,moi65/cookiecutter,cguardia/cookiecutter,vincentbernat/cookiecutter,stevepiercy/cookiecutter,0k/cookiecutter,venumech/cookiecutter,agconti/cookiecutter,tylerdave/cookiecutter,moi65/cookiecutter,ramiroluz/cookiecutter,luzfcb/cookiecutter,christabor/cookiecutter,stevepiercy/cookiecutter,sp1rs/cookiecutter,sp1rs/cookiecutter