• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Converting certain characters from Unicode to ASCII
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Converting certain characters from Unicode to ASCII
      • From: Clark Cox <email@hidden>
  • Prev by Date: Re: Unwanted Deployment folder
  • Next by Date: Non-Document App & Binding to Delegate ...
  • Previous by thread: Re: Sync Services
  • Next by thread: Re: Converting certain characters from Unicode to ASCII
  • Index(es):
    • Date
    • Thread