problem with python and unicode string

2009-01-27 Thread bart van deenen
Hi all I'm using the python generated code to create a generic gpb object editor, and I've run into unicode issues. Here's a small example for the protofile example.proto # example.proto message test { required string s=1; } #!/usr/bin/python # -*- coding: utf-8 -*- from PyQt4.QtGui import *

Re: solution for python and unicode string already found

2009-01-28 Thread bart van deenen
Oops found it already :-) T.s=ustring.encode('utf-8') and for getting it out ustring2 = T.s.decode('utf-8') Bart --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send

Re: solution for python and unicode string already found

2009-01-28 Thread bart van deenen
On Jan 28, 7:50 pm, Kenton Varda ken...@google.com wrote: What version of protocol buffers are you using?  I believe we added unicode support to Python protobufs in 2.0.1 or 2.0.2, in which case you shouldn't need to manually encode/decode. It's 2.0.3 I'm not at work right now, but will

Re: solution for python and unicode string already found

2009-01-29 Thread bart van deenen
Hi Kenton Here's the details: kubu:~$ protoc --version libprotoc 2.0.3 kubu:~$ python -V Python 2.5.2 This is a self-compiled protoc (because I had added the actionscript output generator). I actually find in CHANGES.txt for 2.0.2 that the Strings now use the unicode type rather than the str

Problem with dynamic __import__ of gpb modules

2009-02-18 Thread bart van deenen
Hi I'm building a generic editor for creating loading and saving gpb objects and am running into problems with dynamic __import__ statements. I've nailed it down to a very simple testcase. This is all with python 2.5.2 and protobuf 2.0.3 on Linux. test.proto: message test {optional int32

Is it possible to delete one item of a 'repeated' message field (in Python)

2009-02-19 Thread bart van deenen
I'm building a generic gpb editor, that can create gpb encoded files. The UI is completely dynamic, based on the .proto files that one chooses (http://github.com/bvdeenen/gpbedit/tree/master) In this editor I'm currently generating a gpb object on the fly, but since it's a gui editor, it is

Inheriting from generated C++ classes for adding Qt QString accessors. Problems expected?

2009-03-09 Thread bart van deenen
Hi all I'd like to add some Qt specific addditions to some generated gpb classes, but I note the warning on the first C++ page of the documentation: You should not create your own Foo subclasses. If you subclass this class and override a virtual method, the override may be ignored, as many

Re: generating proto documentation

2009-03-17 Thread bart van deenen
to a documentation format.  I still think the best option would be to update doxygen to support reading the .proto files, but it is also the most work (maybe not in the long term). Mark On Tue, Mar 17, 2009 at 8:28 PM, bart van deenen bart.vandee...@gmail.comwrote: Hi all How do you

Re: Howto build protobuf not as library, but directly linking object files?

2009-07-10 Thread bart van deenen
On Jul 9, 8:54 pm, Alex Black a...@alexblack.ca wrote: Hey Bart, I'm not sure I'm seeing the full details of your situation, But on windows I compiled a library libprotobuf.lib, and linked to it statically, meaning it gets built into the exe (or dll) you're building. (I built 2 actually, a

Re: Howto build protobuf not as library, but directly linking object files?

2009-07-10 Thread bart van deenen
Thank you thank you thank you! You're my savior :-) --~--~-~--~~~---~--~~ 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