-
-
Notifications
You must be signed in to change notification settings - Fork 384
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
field "cc.arduino.cli.commands.Library.Maintainer" contains invalid UTF-8 #1907
Comments
This comment was marked as resolved.
This comment was marked as resolved.
Do you have the |
I didn't install arduino-cli. Doesn't v0.0.3-alpha.preview have cli bundled? |
Yes, but if it's found in the global PATH, that version is taken (see arduino/arduino-pro-ide#142). |
|
Hi @JAndrassy. Thanks so much for taking the time to report this! Would you mind downloading the new 0.1.4 release of Arduino Pro IDE or and letting us know whether the bug still occurs? From the message, I suspect that the issue is specific to the contents of one of the package index files provided by the Boards Manager URLs. Do you remember if you were using any custom URLs, or did you just have the default configuration, which only provides Boards Manager with the official Arduino package index? |
sorry. Per. I don't have time now for this. the problem then was my name in my published library. I modified library.properties for next version, so now library.properties of my libraries doesn't have UTF character |
Thats enough for me (and yeah, I'm dumb for saying it was a package index). I found the culprit here (ANSI encoding):
Steps to reproduce:
The compilation process fails:
You can see that the code actually compiled just fine, but this error will block uploading. The issue does not occur when doing the same with the classic Arduino IDE or Arduino CLI. |
@per1234 what's your advice on this? |
In order to fully form an opinion, I would need to understand two things:
If it can be done without significantly harming the maintainability of the code, I'm all for it. Even if we document a UTF-8 requirement in the specifications, people are still going to end up inadvertently using other encodings, so there will always be a benefit to supporting them. But if this is something difficult to support, then I would want to be able to understand better the cost vs benefit balance. Maybe @silvanocerza or @kittaakos would be able to provide some insight into what would we needed to support other encodings. Maybe @JAndrassy would be able to provide some insight into the use case for non-UTF-8 encoding. |
Normally a .properties file should be ISO 8859-1 encoding (Latin-1) and non-Latin-1 characters should be entered by using Unicode escape characters. I use Eclipse IDE and it automatically uses 8859-1 for .properties files. |
People suggest using What do you think @cmaglie? |
Looking at this article https://en.wikipedia.org/wiki/.properties I see that, starting from Java 9, the default encoding has been changed to UTF-8
maybe we can implement a fallback to ISO-8859-1 in the properties parser. BTW if this turns out to be too much work I would just stick to UTF-8. |
It's not about the properties parser, but the fact that the arduino-cli/rpc/commands/lib.proto Lines 142 to 143 in b2b9fba
So no matter what you do with the parser on the CLI side, non-UTF-8 chars won't go through the wire if the gRPC property is From the docs:
|
Yes, what I mean is that we must check that the string is UTF8 before sending it (in this case the input comes from a library.properties file so IMHO we should improve the checks there). Otherwise, what's the point of sending a malformed UTF-8? you won't have any chance to display it correctly since you don't know the encoding... |
In the arduino-cli to read the libary.properties we use the parser here -> https://github.com/arduino/go-properties-orderedmap/blob/master/properties.go#L177 I did not investigate how to do UTF-8 sanity checks in golang, BTW fixing this function (to reject non-UFT8 or to fallback to ISO-8859-1 as for java properties files) would automatically solve this issue. We should probably move this issue to the |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as resolved.
This comment was marked as resolved.
* Added test for #1907 * Updated github.com/arduino/go-properties-orderedmap to v1.7.1
Describe the problem
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
Operating system
Operating system version
Additional context
Additional reports
The text was updated successfully, but these errors were encountered: