Attempt to convert the non UTF-8 strings to UTF-8

This commit is contained in:
Adrien Loison committed 2015-07-27 20:59:12 -07:00
1 parent d946f12951
commit 5e1cfbfdbd
18 files changed
+620 -109

No files matched your search

+2 -2
View File
@@ -4,6 +4,7 @@ namespace Box\Spout\Writer\CSV;
use Box\Spout\Writer\AbstractWriter;
use Box\Spout\Common\Exception\IOException;
use Box\Spout\Common\Helper\EncodingHelper;
/**
* Class Writer
@@ -15,7 +16,6 @@ class Writer extends AbstractWriter
{
/** Number of rows to write before flushing */
const FLUSH_THRESHOLD = 500;
const BOM_UTF8 = "\xEF\xBB\xBF";
/** @var string Content-Type value for the header */
protected static $headerContentType = 'text/csv; charset=UTF-8';
@@ -61,7 +61,7 @@ class Writer extends AbstractWriter
protected function openWriter()
{
// Adds UTF-8 BOM for Unicode compatibility
$this->globalFunctionsHelper->fputs($this->filePointer, self::BOM_UTF8);
$this->globalFunctionsHelper->fputs($this->filePointer, EncodingHelper::BOM_UTF8);
}
/**