decoding a UTF-8 NSString

October 30, 2009

I came across this issue when I received a UTF-8 encoded stringĀ from a URL. I was expecting the UTF-8 string to be automatically decoded, but then I realized that it’s probably not trivial to identify a UTF-8 string, so NSString doesn’t automatically do this for a reason. (Unfortunately, this realization came only after I’d been […]

2

converting NSString to JSON string

October 29, 2009

I needed a quick way to encode an NSString to be used in a JSON object in an iPhone project. There are libraries to do this like TouchJSON, but I didn’t want to link a whole library to insert a string into a Facebook query.

1