예제 #1
0
파일: csv_py2.py 프로젝트: sv1jsb/petl
 def writerow(self, row):
     self.writer.writerow([unicode(s).encode("utf-8") if s is not None else None for s in row])
     # Fetch UTF-8 output from the queue ...
     data = self.queue.getvalue()
     data = data.decode("utf-8")
     # ... and reencode it into the target encoding
     data = self.encoder.encode(data)
     # write to the target stream
     self.stream.write(data)
     # empty queue
     self.queue.truncate(0)
예제 #2
0
파일: csv_py2.py 프로젝트: Mgutjahr/petl
 def writerow(self, row):
     self.writer.writerow([unicode(s).encode('utf-8') if not s==None else None for s in row])
     # Fetch UTF-8 output from the queue ...
     data = self.queue.getvalue()
     data = data.decode('utf-8')
     # ... and reencode it into the target encoding
     data = self.encoder.encode(data)
     # write to the target stream
     self.stream.write(data)
     # empty queue
     self.queue.truncate(0)