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
protoc doesn't support files starting with Byte order marks. #592
Comments
@anandolee, I was hoping you could take a look at this. If you are too busy, feel free to assign me and I will try to find some time to address this. @jskeet FYI (I think we've mentioned this problem once somewhere). |
It is not only related to C#, parser.cc will be changed to support BOM? |
I think the .proto file is a UTF8 encoding file, withnot BOM. |
as @anandolee suggested, this is basically a question which encodings should be considered valid for .proto file. If we don't support 0xfeff mark at the beginning of the proto file, we are making life harder for Visual Studio users. |
Protobuf only support utf-8 encoded files, but I can see it's a pain to deal with BOM added automatically by visual studio. I would vote for updating our parser to ignore BOM. |
Will update our parser to ignore BOM |
Thanks! |
Trying to compile .proto file starting with unicode byte order mark ( U+FEFF character) results in an error.
This is extremely painful in Visual Studio, which saves all files with a byteorder mark, so basically every .proto file that you write in Visual Studio editor will be considered broken by protoc.
The error message is also not very helpful:
health.proto:1:1: Interpreting non ascii codepoint 239.
[libprotobuf WARNING google/protobuf/compiler/parser.cc:491] No syntax specified
for the proto file. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to
specify a syntax version. (Defaulted to proto2 syntax.)
health.proto:1:1: Expected top-level statement (e.g. "message").
health.proto:1:2: Interpreting non ascii codepoint 187.
health.proto:1:3: Interpreting non ascii codepoint 191.
The text was updated successfully, but these errors were encountered: