[ZBX-10929] Can't use unicode in LLD JSON string Created: 2016 Jun 21 Updated: 2017 May 30 Resolved: 2016 Jun 27 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Proxy (P), Server (S) |
Affects Version/s: | 3.0.2 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Trivial |
Reporter: | Fernando Schmitt | Assignee: | Unassigned |
Resolution: | Duplicate | Votes: | 0 |
Labels: | json, lld, unicode, utf8 | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
CentOS 6.7 |
Attachments: |
![]() ![]() ![]() ![]() |
||||||||
Issue Links: |
|
Description |
Create a external check script to mimick a LLD with non-ascii characters 'çã', using 3 methods: 1. UTF-8 encoded unicode: 0xc3 0xa7 0xc3 0xa3 This can be achieved with the following code: #!/bin/bash echo '{"data":[{"{#IFNAME}":"çã"},{"{#IFNAME}":"'"$(echo 'çã' | iconv -t iso88591)"'"},{"{#IFNAME}":"\u00e7\u00e3"}]}' Note that the script assumes your environment to be UTF-8. Now create a LLD rule and use the external script as key (check xml host example). Zabbix will do the following: 1. UTF-8 byte sequence will be interpreted as ISO-8859-1 and get doubly encoded to 0xc3 0x83 0xc2 0xa7 0xc3 0x83 0xc2 0xa3 (çã) Please check the screenshots. |
Comments |
Comment by Fernando Schmitt [ 2016 Jun 22 ] |
If the script is used as a normal item (instead of a LLD rule), there is no double-encoding issue: TIMESTAMP VALUE 2016-06-21 19:13:38 {"data":[{"{#IFNAME}":"çã"},{"{#IFNAME}":"??"},{"{#IFNAME}":"\u00e7\u00e3"}]} |
Comment by Aleksandrs Saveljevs [ 2016 Jun 22 ] |
The çã entry seems to work well for me - the LLD item is correctly created with item key xxx[çã]. Could you please try upgrading to Zabbix 3.0.3 and check whether this issue could be a duplicate of |
Comment by Aleksandrs Saveljevs [ 2016 Jun 22 ] |
By the way, thank you for a quality report, a detailed description, and useful attachments! |
Comment by Fernando Schmitt [ 2016 Jun 22 ] |
yes, it is solved in 3.0.3! thanks! |
Comment by Aleksandrs Saveljevs [ 2016 Jun 27 ] |
Thank you! Closing as a duplicate of |