Skip to content

Inconsistent conversion of escaped characters (character entities) - ', & #527

@aushev

Description

@aushev

Describe the bug
When text in the cell contains escaped characters written like &apos;, &amp; etc - some of them are converted (&lt; becomes < etc) while others are not (&amp; remains the same).

To Reproduce
Create an xlsx file with the following text in the cell:
B&amp;J @ 12 O&apos; clock. It's &lt; 3

run the code:

dt1 <- openxlsx::read.xlsx(fn1); 
dt1$col1

Expected behavior
Ideally, should have the content unchanged:
B&amp;J @ 12 O&apos; clock. It's &lt; 3
At worst, should convert all such characters in the same way:
B&J @ 12 O' clock. It's < 3

Screenshots

Image

Note that other packages (openxlsx2, readxl) treat it correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions