Identify that when getting a $bean
the special characters are incorrectly encoded. For example in an after_save
hook to correct this I do the following
public function upsertContact(SugarBean $bean, string $event, $arguments): bool
{
// Decodes HTML entities in the first name and last name fields.
$bean->first_name = html_entity_decode($bean->first_name, ENT_QUOTES, 'UTF-8');
$bean->last_name = html_entity_decode($bean->last_name, ENT_QUOTES, 'UTF-8');
// ...
}
In mysql when checking SHOW VARIABLES LIKE 'character_set_database';
I get utf8mb4
same result when checking SHOW VARIABLES LIKE 'character_set_connection';
How can I fix this incorrect encoding of special characters throughout the application?
Thanks