Skip to content

I think that it must be replaced spaces without the Unicode option when outputting Excel. #1284

@tommykoko

Description

@tommykoko

This is:

- [X] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

The processDomElement method dose not replace IDEOGRAPHIC SPACE(S) to a half-width space.

What is the current behavior?

The processDomElement method replaces IDEOGRAPHIC SPACES to a half-width space.

What are the steps to reproduce?

Outputting Excel with the text which has IDEOGRAPHIC SPACE(S) like below.

 ★
  ★

The processDomElement method in PhpOffice\PhpSpreadsheet\Reader\Html treats and replaces IDEOGRAPHIC SPACE (Full-width space) as Unicode to a half-width space like below.
So IDEOGRAPHIC SPACES is replaced to a half-width space.

CODE as is

$domText = preg_replace('/\s+/u', ' ', trim($child->nodeValue));

HTML does not replace IDEOGRAPHIC SPACES to a half-width space.

And many Japanese people use IDEOGRAPHIC SPACES as a formating text.
So please replace spaces without the Unicode Option when outputting Excel.

CODE to be

$domText = preg_replace('/\s+/', ' ', trim($child->nodeValue));

Which versions of PhpSpreadsheet and PHP are affected?

Ver 1.10.1

Best regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions