Skip to content

How can I output a UTF-8 CSV that Excel will read properly? #132

@KenDzz

Description

@KenDzz

https://imgur.com/BD1V12I

$_csvEncoding= 'UTF-8';
        $_dataEncoding = 'UTF-8';
        $_newline = "\r\n";
        $_eol = "\r\n";
        $_bom = true;
        $timestamp = time();
        $this->response = $this->response->withDownload('test-'.$timestamp.'.csv');
        $this->set(compact('data', '_dataEncoding' ,'_csvEncoding', '_newline', '_eol', '_bom'));
        $this->viewBuilder()
        ->setClassName('CsvView.Csv')
        ->setOptions([
            'serialize' => 'data',
            'header' => $header,
'extract' => $extract,
]);

It doesn't work.
someone please help me!

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions