Handle invalid UTF-8


/ Published in: Objective C
Save to your folder(s)

Convert UTF-8 NSData to NSString without failing if UTF-8 is invalid. Instead, replace invalid characters with the replacement character (�). This requires some Omni frameworks. Use this as a replacement for NSString's initWithData:encoding: method.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.