Skip to content

Commit

Permalink
VSVGVQ-223 only write BOM once in contest export csv
Browse files Browse the repository at this point in the history
  • Loading branch information
stejes committed Oct 24, 2018
1 parent 5804233 commit 75b0b1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Contest/Controllers/ContestViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private function createCallBackForStreamedCsvResponse(\Traversable $traversableC
$handle = fopen('php://output', 'r+');
fwrite(
$handle,
$this->convertEncoding('sep=,'.PHP_EOL)
chr(0xFF).chr(0xFE).$this->convertEncoding('sep=,'.PHP_EOL)
);

$headerSet = false;
Expand Down Expand Up @@ -227,7 +227,7 @@ private function createCallBackForStreamedCsvResponse(\Traversable $traversableC
*/
private function convertEncoding(string $string): string
{
return chr(0xFF).chr(0xFE).mb_convert_encoding($string, 'UTF-16LE', 'UTF-8');
return mb_convert_encoding($string, 'UTF-16LE', 'UTF-8');
}

/**
Expand Down

0 comments on commit 75b0b1a

Please sign in to comment.