I'm curious if others are seeing a similar error in their Craft logs. It says:

Buggy iconv installed. Will fallback to mbstring.

It's repeated over and over seemingly with almost every request.

It's a pretty simple server, setup using the default setting from Laravel Forge on Digital Ocean.

Any ideas on how to fix it?

  • I have the same issue, same setup (DO+Laravel Forge). Nov 11 '14 at 14:21
  • What did you install to fix this?
    – Sandy D.
    May 5 '16 at 17:18

Iconv is a system C library that converts string encodings, and is generally preferable to PHP’s mb_convert_encoding() because it supports significantly more character encodings. However it’s not guaranteed that it will be available, and if it is, some versions of it have a bug that could put it into an infinite loop in certain circumstances. So Craft’s StringHelper::convertToUTF8() checks for those things before using it, and logs if it’s not available or a buggy version is installed, before falling back on mb_convert_encoding().

  • Interesting, thanks for the update brandon. Is it worth the effort for me to try and update it on our servers or is any performance hit not really worth it? Nov 11 '14 at 20:03
  • @KeithMancuso I don't think it's so much about a performance hit as much as iconv is just more feature rich, so up to you.
    – Brad Bell
    Nov 11 '14 at 21:17
  • @KeithMancuso It’s better because it supports more character encodings. Just updated my answer to clarify that. Nov 11 '14 at 22:56
  • I've seen this warning on several sites as well and been asked by clients why the warning is there. So far, it hasn't been an issue but could this answer be extended to indicate what "more character encodings" means? Are there specific languages or situations we should be aware of that may require using iconv? Sep 11 '17 at 14:58
  • 1
    @BenParizek Long story, short... I wouldn't worry about it. We've removed that check for Craft 3. It came from HTMLPurifier originally, but we've never ran into an environment where it was an issue and it's caused more support than it ever solved.
    – Brad Bell
    Sep 11 '17 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.