Home > Docs > Product Import Export Plugin for WooCommerce > Resolve error – Call to undefined function mb_detect_encoding()

Resolve error – Call to undefined function mb_detect_encoding()

Last updated on November 13, 2024

While importing or exporting products using CSV files with the Product Import Export Plugin for WooCommerce, you may encounter errors like “Call to undefined function mb_detect_encoding()”. This typically happens if the MBString extension is not enabled on your server.

MBString is a non-default PHP extension that needs to be explicitly enabled using the configure option. The mb_detect_encoding() function, which falls under the MBString category, checks the character encoding of the file being processed.

This function ensures that the CSV file is properly encoded in UTF-8, which is the default character encoding format supported by the Product Import Export Plugin for WooCommerce. To resolve this error, you will need to enable the MBString extension on your server, ensuring smooth imports and exports of product data.

In order to enable MBString support in your WHM/CPanel VPS you need to complete the following steps:

  1. Login to WHM as root
  2. Go to Software -> EasyApache
  3. If prompted to upgrade, do so then repeat step 2
  4. Begin customizing based on the current profile
  5. Proceed through the screens until you get to “Step 5”
  6. On “Step 5,” click on “Exhaustive Options”
  7. Under PHP, check the checkbox for MBString
  8. Proceed with Build & Compile Process
  9. Make sure you wait for the build to complete.

On the other hand, to enable the MBString library in Windows package installations, follow the below steps:

  1. Open the php.ini file found in the moodle/apache/bin folder or Windows folder
  2. Find the line ;extension=php_mbstring.dll
  3. Remove the semicolon ;  at the beginning of the line
  4. Restart Apache if necessary