I want to split a NSString into NSStrings that have no more than 75 octets (in UTF8 representation) each.
If my NSString would be completely ascii it would be a no-brainer.
But since the resulting string could have any length between 18 and 75 characters I have no real idea how to do it.
what’s the way to do this?
Convert the string into octets, take the first 75, convert it back to NSString and hope that NSString tells me that I’ve ripped an utf8-character into two parts?
the answer of warren showed me that I was on the right track. This is what I came up with: