6

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?

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

1 Answer 1

5

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().

5
  • 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? Commented Nov 11, 2014 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
    Commented Nov 11, 2014 at 21:17
  • @KeithMancuso It’s better because it supports more character encodings. Just updated my answer to clarify that. Commented Nov 11, 2014 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? Commented Sep 11, 2017 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
    Commented Sep 11, 2017 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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