We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e48573b + 2cd2fee commit 5037623Copy full SHA for 5037623
src/File/Json.php
@@ -16,7 +16,8 @@ class Json extends AbstractFile
16
'enclosure' => '"',
17
'escape' => '\\',
18
'join' => '_',
19
- 'null' => null
+ 'null' => null,
20
+ 'utf8_encoding' => false
21
];
22
23
/**
@@ -43,6 +44,9 @@ public function convert(): string
43
44
protected function toCsvString(array $data): string
45
{
46
$f = fopen('php://temp', 'wb');
47
+ if($this->conversion["utf8_encoding"]) {
48
+ fprintf($f, chr(0xEF).chr(0xBB).chr(0xBF));
49
+ }
50
$this->putCsv($f, array_keys(current($data)));
51
array_walk($data, function ($row) use (&$f) {
52
$this->putCsv($f, $row);
0 commit comments