Skip navigation.
 
mlRe: NSString ASCII filter
FROM : James Hober
DATE : Tue Feb 12 22:29:10 2008

On Feb 12, 2008, at 12:04 PM, Sean McBride wrote:


> On 2/12/08 11:58 AM, James Hober said:
>
>

>> What is the simplest, reasonably efficient way to determine if an
>> NSString contains a non-ASCII character
>>

>
> How about:
>
> BOOL foo = [string canBeConvertedToEncoding:
>  NSASCIIStringEncoding];
>


Yes!  A one liner for simple task.  Thanks!

James

Related mailsAuthorDate
mlNSString ASCII filter James Hober Feb 12, 20:58
mlRe: NSString ASCII filter Aki Inoue Feb 12, 21:01
mlRe: NSString ASCII filter Sean McBride Feb 12, 21:04
mlRe: NSString ASCII filter James Hober Feb 12, 22:29