Skip to content

JSON encode using HEX QUOTES on non-flattened XML structures-EAD and Sync Importer #257

@DiegoPino

Description

@DiegoPino

What?

Both EAD importer and the Sync (also EAD) importer use some fixed decisions on to what level to flatten XML. In specific for children (containers) of an EAD we do that often. The XML to ARRAY conversion is then encoded as JSON into a CSV cell. But. I have seen in the wild (incorrect XML) escaped double quotes inside XML values. When that happens , and since we are already not using an escape character in other places and encoding via UTF8 double quotes that are not field separators and actually inside values, we end with two types of encodings that drive the reverse process
(CSV back to JSON) crazy

Solution is simple. When no flattening is needed, also use | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT flags.

Nobody should have seen that happen before, but well, I did.

Metadata

Metadata

Assignees

Labels

AMI Import PluginsGets data from somewhere, puts data into a strawberry baskedCSV ProcessingThings we do here and there to keep the tabulated goddesses happyExternal BugIt is not my fault (anonymous Geologist)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions