Thanks Ilia Mirkin,
What I gave is just a part of message, the files generated are sometimes 
more than 4 MB in size. And this issue is spread across the fields. How to 
identify when and where apply the Unicode conversion will become issue.

Regards,
Nishant

On Monday, March 9, 2015 at 4:36:53 PM UTC-4, Ilia Mirkin wrote:

> On Mon, Mar 9, 2015 at 4:19 PM, Nishant Verma <nishan...@gmail.com 
> <javascript:>> wrote: 
> > There is a multibyte character in one of the string field of the 
> Protobuf 
> > messages. When I am serializing or de-serilizig characters are getting 
> > corrupted. Please advise solution. 
> > 
> > 
> > Corrupted message: 
> >  analyst { 
> >   analystNumber: 29003798 
> >   analystLastName: "Azconegui" 
> >   analystFirstName: "Mar\303\255a Valeri" 
>
> Seems fine... 
>
> >>> unicode('\303\255', "utf8") 
> u'\xed' 
>
> i.e. U+00ED, which is 
>
> http://www.fileformat.info/info/unicode/char/00ed/index.htm 
>
> i.e. that í character. 
>
> > 
> > Expected message: 
> >  analyst { 
> >   analystNumber: 29003798 
> >   analystLastName: "Azconegui" 
> >   analystFirstName: "María Valeri" 
> > 
> > 
> > Serializing: 
> > String issuerDataURL ="c:/fileSerilized.ser"; 
> > Issuer.IssuerData dataToBeWritenToSer = issuerDataBuilder.build(); 
> > FileOutputStream fileOut = new FileOutputStream(issuerDataURL); 
> > 
> > dataToBeWritenToSer.writeTo(fileOut); 
> > 
> > 
> > De-Serializing: 
> > String writeTo =  "C:\\DeSer\\20150308193244042.ser.txt"; 
> > FileOutputStream fos = new FileOutputStream(writeTo); 
> > ObjectOutputStream oos = new ObjectOutputStream(fos); 
> > oos.writeObject(isd.toString()); 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Protocol Buffers" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to protobuf+u...@googlegroups.com <javascript:>. 
> > To post to this group, send email to prot...@googlegroups.com 
> <javascript:>. 
> > Visit this group at http://groups.google.com/group/protobuf. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to