[protobuf] Re: Error when trying to compile the exampe proto
File -> Advanced Save Options... -> Encoding: Unicode (UTF-8 without signature) - Codepage 65001 Marc 2009/11/13 Kenton Varda > There should be a setting somewhere in visual studio to make it not use > BOMs. > > > On Thu, Nov 12, 2009 at 6:10 PM, Tommi Laukkanen < > tommi.s.e.laukka...@gmail.com> wrote: > >> Hi >> >> Thank you for the information. I use visual studio which seem to be root >> of the problem. Now I created the file with notepad and it works. >> >> -tommi >> >> >> > > > > -- Regards, Marc --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~--~~~~--~~--~--~---
[protobuf] Re: Error when trying to compile the exampe proto
There should be a setting somewhere in visual studio to make it not use BOMs. On Thu, Nov 12, 2009 at 6:10 PM, Tommi Laukkanen < tommi.s.e.laukka...@gmail.com> wrote: > Hi > > Thank you for the information. I use visual studio which seem to be root of > the problem. Now I created the file with notepad and it works. > > -tommi > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~--~~~~--~~--~--~---
[protobuf] Re: Error when trying to compile the exampe proto
Hi Thank you for the information. I use visual studio which seem to be root of the problem. Now I created the file with notepad and it works. -tommi --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~--~~~~--~~--~--~---
[protobuf] Re: Error when trying to compile the exampe proto
(damn, I forgot to reply-all again!) It is also entirely possible that the two things are unrelated, in which case: sorry for any confusion. But I do know that it is painfully easy to get BOM-heavy files if you use Visual Studio, and that protoc doesn't like it; I can't remember which error message it displays. I guess the real thing to do is to look at the file as binary: how does it start? Marc 2009/11/12 Kenton Varda > Marc points out that your editor is probably placing a UTF-8 BOM at the > beginning of the file. I had assumed this couldn't be the cause because > UTF-8 characters and control characters are different things. However, > looking at the code, there appears to be a bug where if char is signed on > your system, UTF-8 chars will be consider to be control characters (because > they are thus negative and therefore < 0x20). So maybe that is the issue. > > I'd be happy to accept a patch which makes protoc ignore UTF-8 BOMs. > > > On Thu, Nov 12, 2009 at 1:45 PM, Kenton Varda wrote: > >> The error indicates that the first byte of the file is a non-whitespace >> character with ASCII value < 0x20. You need to remove this invalid byte >> from the file. >> >> >> On Thu, Nov 12, 2009 at 11:36 AM, Tommi Laukkanen < >> tommi.s.e.laukka...@gmail.com> wrote: >> >>> >>> Hello >>> >>> I am getting a bit desperate because of this problem. >>> >>> What ever I do, I keep getting: >>> >>> Test.proto:1:1: Invalid control characters encountered in text. >>> >>> When I try to compile the example proto with protoc on Windows Vista >>> Ultimate 64: >>> >>> package tutorial; >>> >>> option java_package = "com.example.tutorial"; >>> option java_outer_classname = "AddressBookProtos"; >>> >>> message Person { >>> required string name = 1; >>> required int32 id = 2; >>> optional string email = 3; >>> >>> enum PhoneType { >>>MOBILE = 0; >>>HOME = 1; >>>WORK = 2; >>> } >>> >>> message PhoneNumber { >>>required string number = 1; >>>optional PhoneType type = 2 [default = HOME]; >>> } >>> >>> repeated PhoneNumber phone = 4; >>> } >>> >>> message AddressBook { >>> repeated Person person = 1; >>> } >>> >>> any ideas? >>> >>> -tommi >>> >>> >>> >> > > > > -- Regards, Marc --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~--~~~~--~~--~--~---
[protobuf] Re: Error when trying to compile the exampe proto
Marc points out that your editor is probably placing a UTF-8 BOM at the beginning of the file. I had assumed this couldn't be the cause because UTF-8 characters and control characters are different things. However, looking at the code, there appears to be a bug where if char is signed on your system, UTF-8 chars will be consider to be control characters (because they are thus negative and therefore < 0x20). So maybe that is the issue. I'd be happy to accept a patch which makes protoc ignore UTF-8 BOMs. On Thu, Nov 12, 2009 at 1:45 PM, Kenton Varda wrote: > The error indicates that the first byte of the file is a non-whitespace > character with ASCII value < 0x20. You need to remove this invalid byte > from the file. > > > On Thu, Nov 12, 2009 at 11:36 AM, Tommi Laukkanen < > tommi.s.e.laukka...@gmail.com> wrote: > >> >> Hello >> >> I am getting a bit desperate because of this problem. >> >> What ever I do, I keep getting: >> >> Test.proto:1:1: Invalid control characters encountered in text. >> >> When I try to compile the example proto with protoc on Windows Vista >> Ultimate 64: >> >> package tutorial; >> >> option java_package = "com.example.tutorial"; >> option java_outer_classname = "AddressBookProtos"; >> >> message Person { >> required string name = 1; >> required int32 id = 2; >> optional string email = 3; >> >> enum PhoneType { >>MOBILE = 0; >>HOME = 1; >>WORK = 2; >> } >> >> message PhoneNumber { >>required string number = 1; >>optional PhoneType type = 2 [default = HOME]; >> } >> >> repeated PhoneNumber phone = 4; >> } >> >> message AddressBook { >> repeated Person person = 1; >> } >> >> any ideas? >> >> -tommi >> >> >> >> > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~--~~~~--~~--~--~---
[protobuf] Re: Error when trying to compile the exampe proto
The error indicates that the first byte of the file is a non-whitespace character with ASCII value < 0x20. You need to remove this invalid byte from the file. On Thu, Nov 12, 2009 at 11:36 AM, Tommi Laukkanen < tommi.s.e.laukka...@gmail.com> wrote: > > Hello > > I am getting a bit desperate because of this problem. > > What ever I do, I keep getting: > > Test.proto:1:1: Invalid control characters encountered in text. > > When I try to compile the example proto with protoc on Windows Vista > Ultimate 64: > > package tutorial; > > option java_package = "com.example.tutorial"; > option java_outer_classname = "AddressBookProtos"; > > message Person { > required string name = 1; > required int32 id = 2; > optional string email = 3; > > enum PhoneType { >MOBILE = 0; >HOME = 1; >WORK = 2; > } > > message PhoneNumber { >required string number = 1; >optional PhoneType type = 2 [default = HOME]; > } > > repeated PhoneNumber phone = 4; > } > > message AddressBook { > repeated Person person = 1; > } > > any ideas? > > -tommi > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~--~~~~--~~--~--~---