On Mon, Mar 9, 2015 at 4:19 PM, Nishant Verma <nishantma...@gmail.com> 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+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.

-- 
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