Skip to content

Allow ISO8859-1 (non UTF-8) .properties files. #1969

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

Merged
merged 2 commits into from
Nov 8, 2022

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Nov 8, 2022

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)

What kind of change does this PR introduce?

Previously .properties files (like library.properties or platform.txt) were considered always as UTF8 encoded. In some cases, this assumption leads to unwanted behavior.

Now the properties files are considered UTF8 if the files is a valid UTF8, otherwise, it is considered ISO8859-1.

What is the current behavior?

See #1907 for more details.

Library Manager doesn't show libraries. Output console shows
[INFO] ERROR: 2019/10/21 21:46:10 grpc: server failed to encode response: rpc error: code = Internal desc = grpc: error while marshaling: proto: field "cc.arduino.cli.commands.Library.Maintainer" contains invalid UTF-8

$ arduino-cli lib list "WiFi Link" --format json | jq .[].library.maintainer
"Juraj Andr�ssy <[email protected]>"

What is the new behavior?

The non-UTF8 file is handled correctly.

$ arduino-cli lib list "WiFi Link" --format json | jq .[].library.maintainer
"Juraj Andrássy <[email protected]>"

Does this PR introduce a breaking change, and is titled accordingly?

No

Other information

Fix #1907

@cmaglie cmaglie self-assigned this Nov 8, 2022
@cmaglie cmaglie added priority: low Resolution is a low priority topic: code Related to content of the project itself criticality: low Of low impact type: imperfection Perceived defect in any part of project labels Nov 8, 2022
@cmaglie cmaglie merged commit 79e6484 into arduino:master Nov 8, 2022
@cmaglie cmaglie deleted the non-utf8-props branch November 8, 2022 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
criticality: low Of low impact priority: low Resolution is a low priority topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

field "cc.arduino.cli.commands.Library.Maintainer" contains invalid UTF-8
2 participants