Character encoding
iamyellow opened this issue · comments
jordi domenech commented
Hi! I came across some character encoding issue.
First, we have an action in a DataObject subclass:
$this->send_action = BetterButtonCustomAction::create('send_notification', _t('Notification.SEND', 'Send this notification'));
The action 'callback' makes a call to a webservice which returns ($result_message) a message id in order to show i18n'ed messages:
$this->send_action->setSuccessMessage(_t($result_message));
The localized text has a latin word 'Notificación'. Although that word is shown correctly across all the CMS, it's not correctly displayed in the "toast" message.
BTW, I managed to solved it:
$this->send_action->setSuccessMessage(rawurldecode(iconv('UTF-8', 'ISO-8859-1', _t($result_message))));
(also tried only with rawurldecode since I've seen it in SS sources, but no success.)
Anyone?