Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-19591

Javascript UTF16LE issue

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 5.4.1
    • Proxy (P), Server (S)
    • Ubuntu 20.04

      Steps to reproduce:

      1.  Script Item with this function:

       

      function strUTF16LE(input){
      output = "";
      for (var i = 0; i < input.length; i++)
       output += String.fromCharCode(input.charCodeAt(i) & 0xFF, (input.charCodeAt(i) >>> 8) & 0xFF);
      return output;
      }
      return strUTF16LE("abcdefg-123456789");
      

       

       

      Result:
      Only the first character (a) is returned
      Expected:
      The whole string (abcdefg-123456789) should be returned, as tested in Mozilla Firefox

            zabbix.dev Zabbix Development Team
            seyfidin Seyfidin Hamraoui
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: