Decodes provided Buffer object to plc STRING using cp1252 encoding or UTF-8. Also removes empty bytes from the end.

  • Parameters

    • data: Buffer

      Buffer data that contains plc STRING

    • UTF8: boolean = false

      If true, the value is handled as UTF-8, otherwise as cp1252.

    Returns string