(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 <ken...@google.com>

> 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 <ken...@google.com> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to