title: Protobuf to json in python
body: <p>I have an object that I de-serialize using <code>protobuf</code> in Python. When I print the object it looks like a python object, however when I try to convert it to <code>json</code> I have all sorts of problems.</p>
  
  <p>For example, if I use <code>json.dumps()</code> I get that the object (the generated code from protoc) does not contain a _ <em>dict</em> _ error.</p>
  
  <p>If I use jsonpickle I get <code>UnicodeDecodeError: 'utf8' codec can't decode byte 0x9d in position 97: invalid start byte</code>. </p>
  
  <p>Test code below is using <code>jsonpickle</code> with the error shown above. </p>
  
  <pre><code>if len(sys.argv) &lt; 2:
      print ("Error: missing ser file")
      sys.exit()
  else :
      fileLocation = sys.argv[1]
  
  org = BuildOrgObject(fileLocation) 
  
  org = org.Deserialize()
  
  
  #print (org)
  jsonObj = jsonpickle.encode(org)
  print (jsonObj)
  </code></pre>