Converting certain characters from Unicode to ASCII
Converting certain characters from Unicode to ASCII
- Subject: Converting certain characters from Unicode to ASCII
- From: Steve Palmer <email@hidden>
- Date: Wed, 6 Jul 2005 05:27:31 -0700
Hopefully a quick question. What is the recommended way to convert
the Unicode character 0x2019 which is an apostrophe to the ASCII
equivalent which is 0x0027? The string has to be down-converted for 7-
bit ASCII transmission and loss of some unconvertable characters is
acceptable but the apostrophe is one that I'd expect should be
convertable. I've tried:
NSData * textData = [[textView string] dataUsingEncoding:
NSASCIIStringEncoding allowLossyConversion:YES];
with a variety of different encoding types but none of them get me
the right ASCII character. At the very least I can do a search and
replace but I'd like to make sure that I've not missed anything obvious.
Thanks!
- Steve
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden