On 17 Jun 08, at 23:16, Wayne Shao wrote:
In my UI, a user may type in any string into a NSTextField, e.g.
Chinese characters.
Do I assume the return value from
NSString * value = [textField stringValue]
is always encoded with UTF8?
NSStrings are encoding-independent. They represent strings, not
sequences of bytes.
I need to convert this to a properly url encoded value as a GET
parameter.
[value stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]
will return a string with proper UTF-8 percent escaping.
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]