Byte array in objective c with ascii encoding
问题 I am trying to get a byte array from an NSString in objective c using ascii encoding. I need to this array to calculate the SHA256 hash of that string and then compare the result to the SHA256 encoding generated in Windows. NSString *myString = @"123456¥"; const char *string = (const unsigned char *) [myString cStringUsingEncoding:NSASCIIStringEncodin]; this always gives nil since it contains the ¥ character. the problem is I cannot use UTF8Encoding since the hash generated by windows uses