moudsen / mailGraph

Zabbix Media module and scripts for sending templated e-mail alerts enriched with multiple configurable graphs and associated event information
MIT License
33 stars 5 forks source link

Incorrect display of international characters in the report #45

Open dima-online opened 2 months ago

dima-online commented 2 months ago

I get a response from api_jsonrpc.php
POST data: {"jsonrpc":"2.0","method":"host.get","params":{"hostids":"11285","output":"extend","selectTags":"extend"},"auth":"4acfd9a31afba53f10a7fea3625b1d42","id":6}

"name": "\u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430"

Twig will encode it in UTF-8 (in default) again. As a result, I receive a letter with the subject "Главный сервер мониторинга"

It is necessary to add to the script code for correct operation

$mail->CharSet = "UTF-8";
$mail->Encoding = "base64";

The specified name should be displayed as "Главный сервер мониторинга".

moudsen commented 2 days ago

Thank you for your valued response - I will update mailGraph shortly and include your recommended update Kind regards, Mark