I am monitoring temperature of some equipments and have to show the character °. I create a program in C# where i process data and send it to zabbix via TCP. At First, i was sending the strings in utf-8 enconding, and in the ° place was being displayed ?, like "?C" instead "°C".
I corrected this by sending 4 bytes using that code:
public static string ConvertToXmlCharacterReference(this string str)
{
var sb = new StringBuilder(str.Length);
foreach(var ch in str)
sb.AppendFormat("&#x{0:X4}", (int)ch);
return sb.ToString();
}
But, at graphs and maps it shows the complete hexadecimal code.
How I can show it correctly?
I corrected this by sending 4 bytes using that code:
public static string ConvertToXmlCharacterReference(this string str)
{
var sb = new StringBuilder(str.Length);
foreach(var ch in str)
sb.AppendFormat("&#x{0:X4}", (int)ch);
return sb.ToString();
}
But, at graphs and maps it shows the complete hexadecimal code.
How I can show it correctly?
Comment