• 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
Re: How to remove accents from characters (i.e. ñ --> n)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to remove accents from characters (i.e. ñ --> n)


  • Subject: Re: How to remove accents from characters (i.e. ñ --> n)
  • From: Ricky Sharp <email@hidden>
  • Date: Wed, 21 Dec 2005 18:21:34 -0600

On Dec 21, 2005, at 1:49 PM, John Fox wrote:

In order to generate usable Mapquest URLs, need a way to remove the accent marks in an NSString, but keep the "base" character. For example, if there is an ñ I need it converted to n, If there is an ß I need it converted to ss.

Is there an easy way to do this? In the past, I've used an NSString category which takes a dictionary where the key is the character you want to replace, and the value is the replacement. The method enumerate the keys in the dictionary and use componentsSepratatedByString and then componentsJoinedByString to do the replacement.

I'm wondering if there's a better and/or easier way.

Does anybody have any suggestions?

Others have pointed out potential solutions, but I have to ask why you need to 'normalize' the URLs? It's possible to have URLs with encoded unicode, but does Mapquest forbid such URLs?

___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com

_______________________________________________
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
References: 
 >How to remove accents from characters (i.e. ñ --> n) (From: John Fox <email@hidden>)

  • Prev by Date: Text Wrap in NSTextField
  • Next by Date: CoreData - crashes on 10.4.3, okay on 10.4.2
  • Previous by thread: Re: How to remove accents from characters (i.e. ñ --> n)
  • Next by thread: Re: How to remove accents from characters (i.e. ñ --> n)
  • Index(es):
    • Date
    • Thread