DaveChild / Text-Statistics

Generate information about text including syllable counts and Flesch-Kincaid, Gunning-Fog, Coleman-Liau, SMOG and Automated Readability scores.
https://readable.com/
BSD 2-Clause "Simplified" License
446 stars 107 forks source link

Fix PHP 8.2 deprecations #60

Open seanBlommaert opened 2 months ago

seanBlommaert commented 2 months ago

Because of the misleading function names, lack of error messages and warnings, and the lack of support for character encodings other than ISO-8859-1, utf8_encode and utf8_decode functions are deprecated in PHP 8.2.

This is being used in \DaveChild\TextStatistics\Text::cleanText()

We can replace it with the code below, or maybe see if we can remove it? $strText = mb_convert_encoding($strText, 'ISO-8859-1', mb_detect_encoding($strText));

seanBlommaert commented 2 months ago

I see there already is a PR for this: https://github.com/DaveChild/Text-Statistics/pull/56 (and more 8.2 deprecations).