Javascript UTF16LE issue

XMLWordPrintable

    • Type: Incident report
    • Resolution: Unresolved
    • Priority: Minor
    • None
    • Affects Version/s: 5.4.1
    • Component/s: Proxy (P), Server (S)
    • Environment:
      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

            Assignee:
            Zabbix Development Team
            Reporter:
            Seyfidin Hamraoui
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: