Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support utf-16 in file and tail inputs #7792

Merged
merged 9 commits into from Jul 7, 2020
Merged

Conversation

danielnelson
Copy link
Contributor

@danielnelson danielnelson commented Jul 7, 2020

closes #7299
closes #6876

Also see changes on influxdata/tail: influxdata/tail@master...influxdata:open-reader-func

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

@danielnelson danielnelson added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Jul 7, 2020
@danielnelson danielnelson added this to the 1.15.0 milestone Jul 7, 2020
@danielnelson danielnelson requested a review from ssoroka July 7, 2020 17:38
if recordFields[p.MeasurementColumn] != nil && recordFields[p.MeasurementColumn] != "" {
measurementName = fmt.Sprintf("%v", recordFields[p.MeasurementColumn])
if p.MeasurementColumn != "" {
if recordFields[p.MeasurementColumn] != nil && recordFields[p.MeasurementColumn] != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how can you compare this without a type assertion?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure about this existing code, so I added some tests, seems to be working. The conditional I added fixes a bug where the measurement name could be set to the value of an empty string named column.

Found this in the spec:

Interface values are comparable. Two interface values are equal if they have identical dynamic types and equal dynamic values or if both have value nil.

@danielnelson danielnelson merged commit be77fba into master Jul 7, 2020
@danielnelson danielnelson deleted the character-encoding branch July 7, 2020 19:43
rhajek pushed a commit to bonitoo-io/telegraf that referenced this pull request Jul 13, 2020
idohalevi pushed a commit to idohalevi/telegraf that referenced this pull request Sep 29, 2020
arstercz pushed a commit to arstercz/telegraf that referenced this pull request Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support non utf-8 encodings in the tail input Support non utf-8 encodings in the file input
2 participants