Correctly encode statements to output encoding
Merge pull request #110 from davispuh/encoding_fix

Correctly encode statements to output encoding