On Jun 15, 2011, at 12:24 PM, Bing Li wrote: > The string can be any length. I put the received strings into a queue and > another thread gets the strings out of the queue and parse there. Actually, > the string is XML. During the test, the string length is always 259.
If it’s XML, you should avoid converting the data into strings yourself, and just pass the raw bytes into the XML parser. That will fix the problem with UTF-8 sequences being split across reads, and it also allows the XML parser to use the metadata in the file to decide what encoding to use. —Jens
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com