Skip to content

Allow the parsing of UTF-16 configuration filesΒ #6662

@Trovalo

Description

@Trovalo

Feature Request

Allow the parsing of UTF-16 LE configuration files and UTF-16 in general
Why? because that's the default encoding used by Windows 10 (UTF-16 LE)
The files created by Telegraf itself will be in UTF-16
if I use the following PowerShell command and then I try to open the generated file I will get the error
.\telegraf.exe --input-filter win_perf_counters --output-filter influxdb config > myConf.conf

Is this urgent? no, it's not, you just need to open the file and save it UTF-8.

just for reference, I've got this small problem with:

  • Win 10 Pro v1903 (but also the previous win version)
  • Windows Server 2019 Standard v 1803

Proposal:

Change the parser so it can support UTF-16 encodings

Current behavior:

When trying to parse a .conf file wich is not in UTF-8 you get an error
Error running agent: Error parsing .<myFileName>.conf, line 1: invalid TOML syntax

Desired behavior:

telegraf can parse UTF-16 encoded files

Use case:

Every recent Windows machine will be able to open the Telegraf generated .conf file without checking if the file has the correct encoding

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions