Change where utf-8 encode is done, refines earlier fix
Merge pull request #139 from nate1280/unicode_fix

Change where utf-8 encode is done, refines earlier fix