Fix unicode issues when writing to CSV

Fix the unicode issue when writing to CSV.