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

Truncator: encoding problems #2154

Closed
dl4pj opened this issue Aug 23, 2018 · 6 comments
Closed

Truncator: encoding problems #2154

dl4pj opened this issue Aug 23, 2018 · 6 comments

Comments

@dl4pj
Copy link

dl4pj commented Aug 23, 2018

Hi,

Truncator::truncateWords has problems truncating texts with german letters.
In short summaries '?' signs are shown instead of "äöü".
Long texts are displayed correctly.

I played around with the Truncator Source to find the source of the Problem.
htmlToDomDocument does not work correctly:
When I set $html = "äöü"; , the output in the Chrome-Browser are ?-signs.

The Problem exists in grave Versions 1.4.x and 1.5.

Thank you!

@dl4pj
Copy link
Author

dl4pj commented Sep 27, 2018

Hi,

is there any Information missing, I can help you with?
Are there any things, I can try?

Thank you,

Peter

@eisenherzz
Copy link
Contributor

eisenherzz commented Feb 2, 2020

Seems that problem still exists in 1.7

@eisenherzz
Copy link
Contributor

Seems to be environment dependant. Works on share hoster A and not on B. Did not find the difference yet. But basically I could narrow down the issue to $html = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'); For some reason umlauts get destroyed (sometimes)

@mahagr
Copy link
Member

mahagr commented Feb 7, 2020

PHP version? Maybe some library?

@eisenherzz
Copy link
Contributor

Many small differences starting with the OS (SunOS where it does not work vs. Linux).
Found a solution which at least worked for me. As I am not a developer somebody should review the change. Will commit it in a few second ;)

@mahagr
Copy link
Member

mahagr commented Feb 10, 2020

You likely mean Solaris as SunOS hasn't been updated for 25 years now. BTW, you can also fix this with php.ini setting, but yeah, we should pass the encoding to the method.

mahagr pushed a commit that referenced this issue Feb 10, 2020
As I am not a developer somebody should review the change.
@mahagr mahagr added the fixed label Feb 10, 2020
mahagr added a commit that referenced this issue Feb 10, 2020
mahagr added a commit that referenced this issue Feb 10, 2020
mahagr added a commit that referenced this issue Feb 10, 2020
@mahagr mahagr closed this as completed Feb 12, 2020
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

4 participants