Re: [protobuf] Re: protobuf not handling special characters between Java server and C++ client

2011-01-25 Thread Kenton Varda
On Tue, Jan 25, 2011 at 8:57 PM, Hitesh Jethwani wrote: > > if on the stream writer, I add something like: > > writer.write(new String(msg.getBytes(), "UTF8").getBytes()) instead of > > simply writer.write(msg.getBytes()), I see the characters as expected > > on the C++ client. However this I beli

[protobuf] Re: protobuf not handling special characters between Java server and C++ client

2011-01-25 Thread Hitesh Jethwani
> I was of the opinion that UTF8 encoding encodes each character using 8 > bits or a byte. My understanding of UTF8 was clearly wrong. Just did some reading again, it encodes characters in bytes, and can use upto 4 bytes to represent a character. > if on the stream writer, I add something like: >

[protobuf] Re: protobuf not handling special characters between Java server and C++ client

2011-01-25 Thread Hitesh Jethwani
Thanks for pointing that out Evans. > The Java protocol buffer API encodes strings as UTF-8. Since C++ has > no unicode support, what you get on the other end is the raw UTF-8 > encoded data. I was of the opinion that UTF8 encoding encodes each character using 8 bits or a byte. So not sure as to wh

Re: [protobuf] ProtocolBuffers and existing classes

2011-01-25 Thread David Yu
Have you looked at http://code.google.com/p/protostuff? It allows you to skip all the code generation and simply use your existing classes (support for cyclic references too) On Tue, Jan 25, 2011 at 10:39 PM, Marco@worldcorp wrote: > Hello > i was wondering if protobuffer supports having an alre

Re: [protobuf] problems with CopyFrom(dynamic message) to generated message

2011-01-25 Thread Kenton Varda
They need to have exactly the same Descriptor object. When you create your DynamicMessage from the DynamicMessageFactory, pass the Descriptor object returned by the generated type's descriptor() or GetDescriptor() method. Don't construct a separate Descriptor manually. Of course, then the questi

Re: [protobuf] Problem with accents in python while unpacking a message

2011-01-25 Thread Kenton Varda
When using non-ASCII characters, make sure you are using the "unicode" type, not "str", to avoid any ambiguity in character encoding. Also, I vaguely remember a bug fix related to this that is in version 2.4.0, so you might try that. On Thu, Jan 20, 2011 at 10:39 AM, Louhike wrote: > Hi, > I'm

Re: [protobuf] Building Protobuffers under linux

2011-01-25 Thread Kenton Varda
I think if -lprotobuf wasn't found, the linker would complain about that first, rather than complain about undefined references -- unless you have some other libprotobuf in your library path which is being taken instead. Maybe an older version? On Wed, Jan 19, 2011 at 10:29 AM, Jalitt wrote: >

Re: [protobuf] Python API docs

2011-01-25 Thread Kenton Varda
Actually version 2.4.0 has been uploaded and is in the file list, just hasn't been marked "current" yet. That said, note that using extend() on a repeated message makes deep copies of all the message objects. Repeatedly calling add() is more efficient. On Wed, Jan 19, 2011 at 6:57 AM, Ben Ford

Re: [protobuf] [ANN] Beefcake - A sane Ruby ProtoBuf library

2011-01-25 Thread Jason Hsueh
Added to the wiki, thanks for contributing! On Sat, Jan 22, 2011 at 12:46 PM, wrote: > I'm please to give the Ruby developers here Beefcake. > > https://github.com/bmizerany/beefcake/tree/master/lib/beefcake > > I would appreciate it if someone would list this on the ThirdPartyAddon > page > of

Re: [protobuf] Re: cannot get extensions from serialized proto -- please help

2011-01-25 Thread Jason Hsueh
Are you looking for something more explicit than http://code.google.com/apis/protocolbuffers/docs/reference/java/com/google/protobuf/MessageLite.Builder.html#mergeFrom(com.google.protobuf.CodedInputStream, com.google.protobuf.ExtensionRegistryLite) ? Perhaps this isn't obvious unless you know what

Re: [protobuf] ProtocolBuffers and existing classes

2011-01-25 Thread Jason Hsueh
No, you cannot refer to arbitrary classes. Doing so would be difficult to support across languages, and significantly complicates features like reflection. On Tue, Jan 25, 2011 at 6:39 AM, Marco@worldcorp wrote: > Hello > i was wondering if protobuffer supports having an already existing > class

Re: [protobuf] protobuf not handling special characters between Java server and C++ client

2011-01-25 Thread Evan Jones
On Jan 25, 2011, at 15:27 , Hitesh Jethwani wrote: As may be evident from above I am naive at Java and Protobuf. Any help on this is appreciated. The Java protocol buffer API encodes strings as UTF-8. Since C++ has no unicode support, what you get on the other end is the raw UTF-8 encoded

[protobuf] protobuf not handling special characters between Java server and C++ client

2011-01-25 Thread Hitesh Jethwani
We have a Java web server. When this sends some string, for instance, É, this is received as multiple bytes on the C++ client end. As a result something like SÉBASTIEN gets displayed like S<2 funny characters>BASTIEN. What I assume is happening internally is that, Java being UTF-16 by default, writ

[protobuf] Re: Issue 158 in protobuf: Push 2.3.0 maven artifact to repo

2011-01-25 Thread protobuf
Comment #9 on issue 158 by tj.rothw...@gmail.com: Push 2.3.0 maven artifact to repo http://code.google.com/p/protobuf/issues/detail?id=158 It appears that 2.4.0's release beat the 2.3.0 push to Google's maven repository. http://code.google.com/p/google-maven-repository/source/browse/reposi

[protobuf] ProtocolBuffers and existing classes

2011-01-25 Thread Marco@worldcorp
Hello i was wondering if protobuffer supports having an already existing class embedded in the message. What i mean: from example i have seen, use writes a .proto buffer and protobuffer generates all related java classes. However, i have already existing classe which i'd like to embed in a .pro