Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Question about NSString stringByAddingPercentEscapesUsingEncoding:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about NSString stringByAddingPercentEscapesUsingEncoding:



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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.