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

Wrong charset conversion in citationStyleLanguage plugin #7765

Closed
marcbria opened this issue Mar 15, 2022 · 6 comments
Closed

Wrong charset conversion in citationStyleLanguage plugin #7765

marcbria opened this issue Mar 15, 2022 · 6 comments
Assignees

Comments

@marcbria
Copy link
Collaborator

Describe the bug

In a full functional OJS stable-3.2.1 (but also in last 3.3.0-10):

With:

  • Tables and fields in utf8mb4_general_ci.
  • Header html declares "utf8".
  • Source code php: text/x-php; charset=us-ascii
  • PHP 7.3.22
  • All plugins up to date.

Only on CitationStyleLanguage plugin I found special chars are removed (accents, non ascii letters).

Log shows the following notice:

PHP Notice:  iconv(): Wrong charset, conversion from `UTF-8' to `ISO-8859-1//IGNORE' is not allowed in /var/www/html/plugins/generic/citationStyleLanguage/lib/vendor/symfony/polyfill-mbstring/Mbstring.php on line 345

To Reproduce
Steps to reproduce the behavior:

  1. Run a ojs 3.3.0-10 "offical" docker container.
  2. Add a journal, author and an article... all with a few special chars (ie: accents)
  3. Enable citationStyleLanguage plugin.
  4. Go to the published article
  5. See error

What application are you using?

  • OJS 3.2.1-4
  • OJS stable-3.2.1
  • OJS 3.3.0-10

Additional information

Mbstring is installed:

$ php -m  | grep mbstring
mbstring

imagen

@jonasraoni checked it and looks like polyfill is always being called:
https://github.com/seboettg/citeproc-php/blob/c1df840d897b938431130445927d48a4b6cf464b/src/Util/StringHelper.php#L141-L143

@asmecher
Copy link
Member

@jonasraoni, would you be able to look into this? (It sounds like you already started!)

@jonasraoni
Copy link
Contributor

Ok!

@marcbria
Copy link
Collaborator Author

@jonasraoni please, let me know if you need help with the testing... or whatever.

@jonasraoni
Copy link
Contributor

Ok @marcbria, I'll take a look on it now 😁

@jonasraoni
Copy link
Contributor

Hi @marcbria,

I just could simulate it using your Docker image, in my environment, which is also under Docker, it worked fine.

So it looks like a problem in the image, I've created an issue against the docker-ojs repository, with the source of the problem and a possible solution.

So, I'll close this issue for now :)

@jonasraoni
Copy link
Contributor

jonasraoni commented Apr 16, 2022

There's also a similar issue here (missing letters + same error message): seboettg/citeproc-php#102

I don't know the reasoning behind always using the polyfill at citeproc-php, but replacing it by the mb_* functions also works, the author seems to be busy, so I didn't bother him with questions :)

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

3 participants