Skip to content

Commit

Permalink
Merge pull request #44 from Antherkiv/master
Browse files Browse the repository at this point in the history
Using UnicodeWriter in CSVZipSheetWriter instead vanilla csv.writer
  • Loading branch information
chfw committed Nov 10, 2017
2 parents 60d375b + a8d3903 commit c5656ac
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pyexcel_io/writers/csvz.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
:copyright: (c) 2014-2017 by Onni Software Ltd.
:license: New BSD License, see LICENSE for more details
"""
import csv
import zipfile

from pyexcel_io._compact import StringIO
from pyexcel_io.book import BookWriter
from pyexcel_io.constants import DEFAULT_SHEET_NAME, FILE_FORMAT_CSVZ

from .csvw import CSVSheetWriter
from .csvw import CSVSheetWriter, UnicodeWriter


class CSVZipSheetWriter(CSVSheetWriter):
Expand All @@ -26,7 +25,11 @@ def __init__(self, zipfile, sheetname, file_extension, **keywords):

def set_sheet_name(self, name):
self.content = StringIO()
self.writer = csv.writer(self.content, **self._keywords)
self.writer = UnicodeWriter(
self.content,
encoding=self._encoding,
**self._keywords
)

def close(self):
file_name = "%s.%s" % (self._native_sheet, self.file_extension)
Expand Down

0 comments on commit c5656ac

Please sign in to comment.