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

Drupal Feeds throw error related to UTF8Utils.php encoding function #228

Open
ChrisB55 opened this issue Feb 28, 2023 · 0 comments
Open

Comments

@ChrisB55
Copy link

Drupal 9 website Drupal core 9.4.11 Web Server nginx/1.20.1. PHP Version 8.0.27 site composer.lock file references "masterminds/html5": "^2.7". The relevant modules are the feeds module and the feeds tamper module.

When attempting to restore txt file assets via the feeds module an error is thrown preventing any of the import file from running. The error will not occur if the .txt has no special characters or encoding. If \22238, or <93>brackets, etc are present the feed will fail and throw an error point to mb_convert_encoding. Around 10%-20% of the assets files in my import won't run and there is no message pointing to which records have the problems until you check individually.

Previously the feeds handled this code correctly, but at some point it stopped possibly related to php 8 or server changes.

Error Message

Message | ValueError: mb_convert_encoding(): Argument #3 ($from_encoding) must specify at least one encoding in mb_convert_encoding() (line 109 of /data/site/vendor/masterminds/html5/src/HTML5/Parser/UTF8Utils.php)#0 /data/site /vendor/masterminds/html5/src/HTML5/Parser/UTF8Utils.php(109): mb_convert_encoding()

Line 109 UTF8Utils.php ( I think it's line 103 in the github repo)
$data = mb_convert_encoding($data, 'UTF-8', $encoding);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant