protoc --encode empty strings #1

Open
opened 2024-04-08 15:00:04 +02:00 by Benjamin_Loison · 1 comment
echo -n 'CgASAnJ1GgA=' | base64 -d | protoc --decode_raw
1: ""
2: "ru"
3: ""
printf 'language:\"ru\"' | protoc --encode="language" language.proto | base64
printf 'one:\"\"\nlanguage:\"ru\"' | protoc --encode="language" language.proto | base64
EgJydQ==
EgJydQ==
echo -n 'EgJydQ==' | base64 -d | protoc --decode_raw
2: "ru"

While Google proceed as wanted when provide CgASAnJ1GgA=, it does not when provide EgJydQ==.

protoc encode empty string does not return interesting results on DuckDuckGo and Google.

blackboxprotobuf does not have this issue.

Context: YouTube-operational-API/issues/262.

```bash echo -n 'CgASAnJ1GgA=' | base64 -d | protoc --decode_raw ``` ``` 1: "" 2: "ru" 3: "" ``` ```bash printf 'language:\"ru\"' | protoc --encode="language" language.proto | base64 printf 'one:\"\"\nlanguage:\"ru\"' | protoc --encode="language" language.proto | base64 ``` ``` EgJydQ== EgJydQ== ``` ```bash echo -n 'EgJydQ==' | base64 -d | protoc --decode_raw ``` ``` 2: "ru" ``` While Google proceed as wanted when provide `CgASAnJ1GgA=`, it does not when provide `EgJydQ==`. `protoc encode empty string` does not return interesting results on DuckDuckGo and Google. [blackboxprotobuf](https://pypi.org/project/blackboxprotobuf/) does not have this issue. Context: [YouTube-operational-API/issues/262](https://github.com/Benjamin-Loison/YouTube-operational-API/issues/262).
Author
Owner

blackboxprotobuf seems to use {} instead of "", should try with that but should first reconstruct my unintentional deleted language.proto.

blackboxprotobuf seems to use `{}` instead of `""`, should try with that but should first reconstruct my unintentional deleted `language.proto`.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Benjamin_Loison/protobuf_google#1
No description provided.