Workaround for CSV#generate encoding issue.
Add integration tests
Add encode options
Merge pull request #3097 from dtaniwaki/encoded-csv-workaround

Workaround for CSV#generate encoding issue.