? Success

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
31 Mar 2016

Summary of Changes

In the case of the OP on #9686 he is getting errors because of the use of iconv() however it's possible for it to not be installed. This changes the stripping of invalid UTF-8 characters to use the phputf8 library instead (note I honestly don't know if there's a difference in the result from iconv() versus utf8_bad_strip() so someone may want to test that).

Testing Instructions

Smart Search indexer should still work and correctly strip invalid UTF-8 characters.

avatar mbabker mbabker - open - 31 Mar 2016
avatar mbabker mbabker - change - 31 Mar 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 31 Mar 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 31 Mar 2016
Category Libraries
avatar infograf768
infograf768 - comment - 31 Mar 2016

could we first check if iconv is installed?

avatar brianteeman
brianteeman - comment - 31 Mar 2016

I thought iconv was a requirement - i know it used to be

avatar mbabker
mbabker - comment - 31 Mar 2016

Its availability is tested in com_admin's sysinfo view but AFAIK it isn't documented anywhere as a requirement.

avatar mbabker
mbabker - comment - 31 Mar 2016

The only places iconv() is explicitly used in Joomla's API is here and StringHelper::transcode(). SimplePie and the IDNA Convert libraries both will optionally use it if available in a couple of functions but those are also wrapped in function_exists() checks and try to use the mbstring extension if available otherwise. And like I noted its support is tested in the system info view but that's really it.

avatar chrisdavenport
chrisdavenport - comment - 31 Mar 2016

I would expect iconv to be considerably faster than something written in PHP, although that is a hypothesis that should be tested. If that is correct then we should prefer iconv and only fall back on something else if it isn't available.

avatar infograf768
infograf768 - comment - 1 Apr 2016

After the test by the original poster, I also suggest we check if iconv exists and fall back to utf8_bad_strip if not.

avatar infograf768 infograf768 - alter_testresult - 18 Jul 2016 - ErikDeMartiis: Tested successfully
avatar joomla-cms-bot joomla-cms-bot - change - 13 Aug 2016
Category Libraries Administration Components
avatar mbabker mbabker - change - 13 Aug 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-08-13 19:01:59
Closed_By mbabker
avatar mbabker mbabker - close - 13 Aug 2016

Add a Comment

Login with GitHub to post a comment