WHMCS import double-encodes UTF-8 text

Sheernox

New Member
Env: ClientExec 7.2.2 (ionCube), PHP 8.5.10, MariaDB 11.8.9. Source WHMCS 9.

Where: plugins/import/whmcs/whmcs2ce.php lines 136 and 157-161

Bug: $_isUtf8 defaults to false and nothing sets it, so _addColumn() runs utf8_encode() on every value. WHMCS 9 data is already UTF-8, so non-ASCII text is double-encoded (é becomes é) in client addresses, ticket subjects and messages. The importer does not reverse the encoding.

Repro: Use a WHMCS ticket subject Problème, export and import. It arrives as Problème.

Error: Deprecated: Function utf8_encode() is deprecated (PHP 8.2+)

Fix: Detect the connection charset (or default to UTF-8) and drop utf8_encode().
 
Back
Top