Skip to content
This repository was archived by the owner on Jan 2, 2019. It is now read-only.

Read multiline cell returns escaped characters like _x000D_ #1096

Open
@andy128k

Description

@andy128k

When I read a cell which contains multiple lines of text, I receive string containing x000D.

I have created workaround, but believe this should be in phpexcel itself.

    function unescape($string)
    {
        return preg_replace_callback('/_x([0-9a-fA-F]{4})_/', function ($matches) {
            return iconv('UCS-2', 'UTF-8', hex2bin($matches[1]));
        }, $string);
    }

Link to corresponding spec: https://msdn.microsoft.com/en-us/library/ff534667(v=office.12).aspx

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions