Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: non UTF-8 character errors #115

Closed
QuarkWave opened this issue Nov 6, 2021 · 4 comments
Closed

[Bug]: non UTF-8 character errors #115

QuarkWave opened this issue Nov 6, 2021 · 4 comments
Assignees

Comments

@QuarkWave
Copy link

Expected behavior

First, thanks for this extension, without it i would havn't been able to migrate to Pimcore X.

Issue :

When importing a file the process should be able to deal with anything we through at it without crashing

Actual behavior

Errors ... because json_encode return a null when a non UTF-8 character is present and the following methods are waiting for an array so it failed

Steps to reproduce

Import any CSV with a non UTF-8 character (like an nonbreaking space , asian currency sign, ...)

Solution ?

Adjust processImportRow in AbstractInterpreter.php

from :
$this->queueService->addItemToQueue($this->configName, $this->executionType, ImportProcessingService::JOB_TYPE_PROCESS, json_encode($data));

to :
$this->queueService->addItemToQueue($this->configName, $this->executionType, ImportProcessingService::JOB_TYPE_PROCESS, json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));

@QuarkWave QuarkWave added the Bug label Nov 6, 2021
@QuarkWave QuarkWave changed the title [Bug]: [Bug]: non UTF-8 character errors Nov 6, 2021
@mcop1
Copy link
Contributor

mcop1 commented Jan 24, 2022

@QuarkWave could you please upload a basic example file, which we can use to reproduce the issue? That would help us a lot.
Thank you for you efforts!

@mittererr
Copy link

Same problem here. The solution provided by @QuarkWave does the trick for me. I can not provide the CSV file of my current use case, because there are address data in it.

@robertSt7
Copy link
Contributor

@QuarkWave , @mittererr Sorry, I am not able to reproduce it. Could you please provide the exact characters? Thanks

@kingjia90
Copy link
Contributor

Closing due inactivity

@kingjia90 kingjia90 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants