-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
Argument file needs support for multi-char and BOM #7474
Comments
CC:
|
I'm not sure if making the
|
Not too deep into C++, but AFAIK this would mean that the whole chain would need to support It's a bit sad to see that UTF-8 is still not the default in 2021 in so many situations (not just here). |
Not supporting UTF-8 in the year 2022 is a complete anachronism. This really must be fixed. |
The original link to command_line_interface.cc is no longer valid. This seems to be the location it was referring to:
|
BOM doesn't need supporting. Grpc.Tools writes out the argument files as utf-8 without BOM. Looking at the protobuf code, the fix isn't changing from Reading each line of the utf-8 encoded file into a io_win32.cc handles conversion from utf8 to The problem seems to be when calling the plugins in subprocess.cc. I've tested my own fix locally. |
…obuf-7474 Fix for grpc.tools protocolbuffers#17995 & protobuf protocolbuffers#7474 (handle UTF-8 paths in argumentfile)
* Force uninstall protobuf in python macos builds We are seeing failures in brew uninstall protobuf due to no package. Change this to a force install to avoid the error. * Fix spelling errors (#10717) * Merge pull request #10200 from tonydnewell/bugfix/protobuf-7474 Fix for grpc.tools #17995 & protobuf #7474 (handle UTF-8 paths in argumentfile) * Upgrade to kotlin 1.6 * 21.x No longer define no_threadlocal on OpenBSD * Upgrade kokoro to Xcode 14 (#10732) * Upgrade kokoro to Xcode 14 * Fix osx errors * Merge pull request #10770 from protocolbuffers/googleberg-cl-480629524 Mark default instance as immutable first to avoid race during static initialization of default instances. * Auto capitalize enums name in Ruby (#10454) (#10763) This closes #1965. * Edit toolchain to work with absl dep * Bump upb to latest version after fixes applied (#10783) * 21.x 202210180838 (#10785) * Updating version.json and repo version numbers to: 21.8 * Update changelog Co-authored-by: Protobuf Team Bot <protobuf-team-bot@google.com> * Update generated protos Co-authored-by: deannagarcia <69992229+deannagarcia@users.noreply.github.com> Co-authored-by: Matt Fowles Kulukundis <matt.fowles@gmail.com> Co-authored-by: Deanna Garcia <deannagarcia@google.com> Co-authored-by: Brad Smith <brad@comstyle.com> Co-authored-by: Jerry Berg <107155935+googleberg@users.noreply.github.com> Co-authored-by: tison <wander4096@gmail.com> Co-authored-by: Protobuf Team Bot <protobuf-team-bot@google.com>
What version of protobuf and what language are you using?
libprotoc 3.3.0 / Grpc.Tools 2.28.1
What operating system (Linux, Windows, ...) and version?
Windows 10 Build 1803
What did you do?
test.rsp
containing non-ascii:protoc.exe @test.rsp
What did you expect to see
protoc
running and creating the files.What did you see instead?
UTF-8 without BOM:
--grpc_out: protoc-gen-grpc: Das System kann die angegebene Datei nicht finden.
UTF-8 with BOM:
You seem to have passed an empty string as one of the arguments to C:\Users\dejhbk0l\.nuget\packages\grpc.tools\2.28.1\tools\windows_x64\protoc.exe. This is actually sort of hard to do. Congrats. Unfortunately it is not valid input so the program is going to die now.
Anything else we should know about your project / environment
https://github.com/protocolbuffers/protobuf/blame/master/src/google/protobuf/compiler/command_line_interface.cc#L1326 uses
std::ifstream
instead ofstd::wifstream
and therefore does not allow BOM or wide characters.This is a minimal example. We stumbled over this in grpc/grpc#17995 as we distribute
protoc
and theprotoc-gen-grpc
through NuGet and the default fordotnet nuget locals global-packages
is%userprofile%\.nuget\packages\
. For some of our users, the username includes non-ascii characters which leads toprotoc-gen-grpc
containing non-ascii characters and the argument file not being parsable.The text was updated successfully, but these errors were encountered: