• 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: Question about NSString stringByAddingPercentEscapesUsingEncoding:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about NSString stringByAddingPercentEscapesUsingEncoding:


  • Subject: Re: Question about NSString stringByAddingPercentEscapesUsingEncoding:
  • From: John Stiles <email@hidden>
  • Date: Mon, 13 Nov 2006 15:07:24 -0800

The docs say
Returns nil if encoding cannot encode a particular character

And ASCII cannot represent é.
You will need to specify Latin-1, or MacRoman, or UTF8, etc.


On Nov 13, 2006, at 2:52 PM, Nicolas Seriot wrote:

Hello,

Consider the following code:

NSLog(@"nonEscapedString %@", nonEscapedString);
NSString *escapedString = [nonEscapedString stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
NSLog(@"escapedString %@", escapedString);


I get:

	nonEscapedString é
	nonEscapedString (null)

Where I expect:

	nonEscapedString é
	nonEscapedString é

(see http://www.w3schools.com/tags/ref_urlencode.asp )

Do I misunderstand the method?

How can I transform "é" into "é"?

Thank you,

--
Nicolas Seriot _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40blizzard.com


This email sent to email@hidden

_______________________________________________ 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: 
 >Question about NSString stringByAddingPercentEscapesUsingEncoding: (From: Nicolas Seriot <email@hidden>)

  • Prev by Date: Re: Modify view animation while running
  • Next by Date: what to do with this string \u00fb\u2013
  • Previous by thread: Question about NSString stringByAddingPercentEscapesUsingEncoding:
  • Next by thread: what to do with this string \u00fb\u2013
  • Index(es):
    • Date
    • Thread