How can the issue of displaying question marks instead of special characters be resolved in PHP when fetching data from an LDAP server?

Issue: When fetching data from an LDAP server in PHP, special characters may not be displayed correctly and instead show up as question marks. This can be resolved by using the `mb_convert_encoding` function to convert the data to the correct character encoding.

// Fetch data from LDAP server
$ldapData = ldap_get_entries($ldapConnection, $ldapSearch);

// Convert data to UTF-8 encoding
foreach ($ldapData as $key => $value) {
    if (is_array($value)) {
        foreach ($value as $k => $v) {
            $ldapData[$key][$k] = mb_convert_encoding($v, 'UTF-8', 'ISO-8859-1');
        }
    } else {
        $ldapData[$key] = mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1');
    }
}

// Now $ldapData will contain the data with correct special characters